User Tools

Site Tools


howto:openfoam

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto:openfoam [2026/02/24 10:50]
ccrosby
howto:openfoam [2026/02/24 13:03] (current)
ccrosby [Latest version: OpenFOAM-v2512]
Line 26: Line 26:
 ### Source the openFOAM environment: ### Source the openFOAM environment:
 . /home/apps/chpc/compmech/OpenFOAM/OF2512 . /home/apps/chpc/compmech/OpenFOAM/OF2512
-##### Running commands 
 # Set this environment variable explicitly. # Set this environment variable explicitly.
 export PBS_JOBDIR=/mnt/lustre/users/username/foamJobs/job01 export PBS_JOBDIR=/mnt/lustre/users/username/foamJobs/job01
 # Explicitly change to the job directory # Explicitly change to the job directory
 cd $PBS_JOBDIR cd $PBS_JOBDIR
 +# Count the number of lines in the hosts file to get the number of processors
 nproc=`cat $PBS_NODEFILE | wc -l ` nproc=`cat $PBS_NODEFILE | wc -l `
 #### These next statements build an appropriate decomposeParDict file #### These next statements build an appropriate decomposeParDict file
-#### based on the requested nunber of nodes+#### based on the requested nunber of processors
 echo "FoamFile" > system/decomposeParDict echo "FoamFile" > system/decomposeParDict
 echo "{"  >> system/decomposeParDict echo "{"  >> system/decomposeParDict
Line 44: Line 44:
 echo "method scotch;" >> system/decomposeParDict echo "method scotch;" >> system/decomposeParDict
 #### End of decomposeParDict file #### End of decomposeParDict file
 +# Decompose the case into processor directories
 decomposePar -force > decompose.out decomposePar -force > decompose.out
-mpirun -np $nproc simpleFoam -parallel > oneapi.out+# Run the solver, simpleFoam in this case 
 +mpirun -np $nproc simpleFoam -parallel > simpleFoam.out 
 +# Reconstruct the time directories from the processor directories 
 +reconstructPar > reconstruct.out 
 +# Clean up the processor directories
 rm -r processor* rm -r processor*
 </file> </file>
/app/dokuwiki/data/attic/howto/openfoam.1771923058.txt.gz · Last modified: 2026/02/24 10:50 by ccrosby