openfoam串行和并行结果不一致,不知道是什么原因?
-
是的,李老师
这是并行计算文件,您方便了帮忙看一下问题出在哪里;#!/bin/bash cd ${0%/*} || exit 1 # Run from this directory # Source PATO run functions . $PATO_DIR/src/applications/utilities/runFunctions/RunFunctions # Initialize the script pato_init # source OpenFOAM and PATO if darwin if [ "$(uname)" = "Darwin" ]; then source $FOAM_ETC/bashrc source $PATO_DIR/bashrc fi # Check number of processors if [ -z $1 ]; then echo "error: correct usage = ./Allrun_parallel <number_processors>" exit 1 fi re='^[0-9]+$' if ! [[ $1 =~ $re ]] ; then echo "error: First argument is not a number" >&2 exit 1 fi NPROCESSOR=$1 # sed command if [ "$(uname)" = "Darwin" ]; then sed_cmd=gsed else sed_cmd=sed fi # change the decomposeParDict files $sed_cmd -i 's/numberOfSubdomains \+[0-9]*;/numberOfSubdomains '"$NPROCESSOR"';/g' system/air/decomposeParDict $sed_cmd -i 's/numberOfSubdomains \+[0-9]*;/numberOfSubdomains '"$NPROCESSOR"';/g' system/core/decomposeParDict $sed_cmd -i 's/numberOfSubdomains \+[0-9]*;/numberOfSubdomains '"$NPROCESSOR"';/g' system/upCore/decomposeParDict $sed_cmd -i 's/numberOfSubdomains \+[0-9]*;/numberOfSubdomains '"$NPROCESSOR"';/g' system/carbon/decomposeParDict # create volume fields (first time step : 50 s) #scp -r origin.0 50 #scp -r constant/porousMat/copy.polyMesh constant/porousMat/polyMesh #scp -r constant/subMat1/copy.polyMesh constant/subMat1/polyMesh rm log.PATOx count=ls -1 processor* 2>/dev/null | wc -l if [ $count != 0 ]; then rm -rf processor* fi # decompose the mesh #setFields -region air decomposePar -allRegions #run case #/usr/bin/mpirun -np $NPROCESSOR PATOx -parallel /usr/bin/mpirun -np $NPROCESSOR PATOx -parallel #runParallel $(getApplication) # 3D post-processing reconstructPar -allRegions # paraFoam -builtin # probe scalar fields (temperature, pressure, density, etc) at desired locations - chosen in system/sampleDict #postProcess -func sampleDict -region porousMat # grab probed fields and copy them into files # postProcessTime <dictName> <regionName> <inputFileName> <outputFileName> #postProcessTime sampleDict porousMat surfacePatch_Ta.xy output/plot_surfacePatch_Ta