Skip to content

Commit

Permalink
Merge pull request #282 from airwarriorg91/master
Browse files Browse the repository at this point in the history
Enable force calculation for STL imported immersed bodies
  • Loading branch information
slaizet committed Jul 29, 2024
2 parents 2c7be99 + 63146ec commit 8cdba7d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
8 changes: 8 additions & 0 deletions examples/Sphere/README
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
please have a look at the Xcompact3d readthedocs website for how to import an STL file and run the simulation for the flow around a sphere.

FIXME: This case will work when (https://github.com/fschuch/xcompact3d_toolbox/issues/63)[https://github.com/fschuch/xcompact3d_toolbox/issues/63] is fixed. To run the case, the current steps are :

1. Remove the lines `iforces = 1` and `nvol = 1` in the ibmstuff section of the input file
2. Remove the section ForceCVs of the input file
3. Run the python script `generate_initial_conditions.py`
4. Restore the input file (revert steps 1 and 2)
5. Run the case
13 changes: 13 additions & 0 deletions examples/Sphere/input.i3d
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,18 @@
nobjmax = 1 ! Maximum number of objects in any direction
npif = 2 ! Number of Points for the Reconstruction (npif=1-3) (Recommended: 2)
nraf = 10 ! Level of refinement for iibm==2 to find the surface of the immersed object
iforces = 1
nvol = 1
/End

!==================
&ForceCVs
!==================
i2dsim = 0 ! select 1 for 2D CV Force Calculation and 0 for 3D CV Force Calculation
xld(1) = 1.5 !X left for volume control
xrd(1) = 3.5 !X right for volume control
yld(1) = 1.5 !Y bottom for volume control
yud(1) = 3.5 !Y top for volume control
zfr(1) = 1.5 !Z front for volume control
zbk(1) = 3.5 !Z back for volume control
/End
5 changes: 3 additions & 2 deletions src/xcompact3d.f90
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ subroutine init_xcompact3d()
open(42,file='time_evol.dat',form='formatted')
endif
endif
if (itype==5) then
if (iforces == 1) then
if(nrank.eq.0)then
open(38,file='forces.dat',form='formatted')
endif
Expand All @@ -297,6 +297,7 @@ subroutine finalise_xcompact3d()
use visu, only : visu_finalise
use les, only: finalise_explicit_les
use mhd, only: mhd_active, mhd_fin
use forces, only: iforces

implicit none

Expand All @@ -307,7 +308,7 @@ subroutine finalise_xcompact3d()
close(42)
endif
endif
if (itype==5) then
if (iforces == 1) then
if(nrank.eq.0)then
close(38)
endif
Expand Down

0 comments on commit 8cdba7d

Please sign in to comment.