anisotropy/temp/tools/run.sh

38 lines
1.0 KiB
Bash
Raw Normal View History

2021-02-26 13:32:59 +05:00
#!/usr/bin/env bash
path=.
#build/simple-cubic/0.1
# python src/genmesh.py
# python src/prefoam.py
# Clean case directory
rm -rf postProcessing processor* *.log logs *.obj constant/polyMesh
# Export and transform mesh
2021-03-01 16:06:53 +05:00
ideasUnvToFoam -case $path mesh.unv
transformPoints -scale '(1e-5 1e-5 1e-5)'
2021-02-26 13:32:59 +05:00
#polyDualMesh 70 -overwrite
checkMesh -case $path -allGeometry -allTopology > checkMesh.log
# Change boundary type for mesh
foamDictionary -case $path constant/polyMesh/boundary -entry entry0.wall.type -set wall
# Case decomposition
decomposePar -case $path
# Initial approximation
2021-03-01 23:52:46 +05:00
mpirun -np 4 --oversubscribe potentialFoam -case $path -parallel | tee -a $path/potentialFoam.log
2021-02-26 13:32:59 +05:00
# Change boundary type for simpleFoam
for n in {0..3}; do
foamDictionary "processor${n}/0/U" -entry boundaryField.inlet.type -set pressureInletVelocity
foamDictionary "processor${n}/0/U" -entry boundaryField.inlet.value -set 'uniform (0 0 0)'
done
2021-03-01 16:06:53 +05:00
sleep 2
2021-02-26 13:32:59 +05:00
# Main calculation
2021-03-01 16:06:53 +05:00
mpirun -np 4 --oversubscribe simpleFoam -parallel -case $path | tee -a $path/simpleFoam.log
2021-02-26 13:32:59 +05:00