-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modification to user_mark & raw data saving mehtod
- Loading branch information
1 parent
7beff2a
commit 82054ec
Showing
9 changed files
with
153 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,10 @@ | ||
!-------------- cemfDEM code: a dem simulation code ---------------------------- | ||
! D C enter of | ||
! D M E ngineering and | ||
! D M M ultiscale modeling of | ||
! D M F luid flow | ||
! EEEEEEEEM .ir | ||
!------------------------------------------------------------------------------ | ||
! Copyright (C): cemf | ||
! website: www.cemf.ir | ||
!------------------------------------------------------------------------------ | ||
! This file is part of cemfDEM code. It is a free software for simulating | ||
! granular flow. You can redistribute it and/or modify it under the terms of | ||
! GNU General Public License version 3 or any other later versions. | ||
! | ||
! cemfDEM code is distributed to help others in their research in the field | ||
! of granular flow, but WITHOUT ANY WARRANTY; without even the implied | ||
! warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
!------------------------------------------------------------------------------ | ||
|
||
subroutine ProgramDefinedGeometry( Geom ) | ||
use g_Geometry | ||
use g_Line | ||
implicit none | ||
class(Geometry),intent(in):: Geom | ||
|
||
!// locals | ||
type(real3) p1, p2, p3, p4 | ||
type(PlaneWall) plane | ||
type(CylinderWall) cyl,cyl1,cyl2 | ||
logical res | ||
|
||
! cylinder shell, the radius is 0.1 m | ||
res = cyl%CreateCylinder( 0.1_RK, 0.1_RK, p_line( real3(0.0, 0.0, 0.0), real3(0.0,0.0, 0.03) ),24, 1, 1 ) | ||
call Geom%add_Cylinder( cyl ) | ||
|
||
! rear wall | ||
res = cyl1%CreateCylinder( 0.001_RK, 0.1_RK, p_line( real3(0.0, 0.0, -0.00001), real3(0.0,0.0, 0.0) ),24, 1, 1 ) | ||
call Geom%add_Cylinder( cyl1 ) | ||
|
||
! front wall | ||
res = cyl2%CreateCylinder( 0.1_RK, 0.001_RK, p_line( real3(0.0, 0.0, 0.03), real3(0.0,0.0, 0.03001) ),24, 1, 1 ) | ||
call Geom%add_Cylinder( cyl2 ) | ||
|
||
|
||
end subroutine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,17 @@ | ||
!-------------- cemfDEM code: a dem simulation code ---------------------------- | ||
! D C enter of | ||
! D M E ngineering and | ||
! D M M ultiscale modeling of | ||
! D M F luid flow | ||
! EEEEEEEEM .ir | ||
!------------------------------------------------------------------------------ | ||
! Copyright (C): cemf | ||
! website: www.cemf.ir | ||
!------------------------------------------------------------------------------ | ||
! This file is part of cemfDEM code. It is a free software for simulating | ||
! granular flow. You can redistribute it and/or modify it under the terms of | ||
! GNU General Public License version 3 or any other later versions. | ||
! | ||
! cemfDEM code is distributed to help others in their research in the field | ||
! of granular flow, but WITHOUT ANY WARRANTY; without even the implied | ||
! warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
!------------------------------------------------------------------------------ | ||
|
||
function User_Mark( id, flag, ptype, dpos ) result (mark) | ||
function User_Mark( id, flag, ptype, dpos, oldMark ) result (mark) | ||
use g_TypeDef | ||
use g_Prtcl_DefaultValues | ||
implicit none | ||
|
||
integer(IK),intent(in):: id, flag, ptype | ||
integer(IK),intent(in):: id, flag, ptype, oldMark | ||
type(real4),intent(in):: dpos | ||
integer(IK) mark | ||
|
||
|
||
|
||
!// locals | ||
real minx, maxx, dx | ||
integer(IK) numx | ||
real(RK) dist | ||
real(RK) d1, d2, d3 | ||
type(real3) pos, point1, point2, point3 | ||
|
||
! position and diameter of regions which are marked as tracer | ||
pos = dpos | ||
d1 = 0.025 | ||
d2 = 0.025 | ||
d3 = 0.025 | ||
point1 = real3(0.0, -0.018, 0.0) | ||
point2 = real3(0.02, -0.042, 0.0) | ||
point3 = real3(0.043, -0.066, 0.0) | ||
mark = oldMark | ||
|
||
return | ||
|
||
! finds particles in each region | ||
if( sqrt((pos%x- point1%x)**2 + (pos%y- point1%y)**2 ) .le. d1/2) then | ||
mark = 1 | ||
elseif( sqrt((pos%x- point2%x)**2 + (pos%y- point2%y)**2 ) .le. d2/2) then | ||
mark = 2 | ||
elseif( sqrt((pos%x- point3%x)**2 + (pos%y- point3%y)**2 ) .le. d3/2) then | ||
mark = 3 | ||
else | ||
mark = 0 | ||
end if | ||
|
||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.