Files
OpenFOAM-12/tutorials/modules/incompressibleFluid/flowWithOpenBoundary/Allrun
Henry Weller ca89189ecd solvers::incompressibleFluid: New solver module for incompressible fluid flow
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces pimpleFoam, pisoFoam and simpleFoam and all
the corresponding tutorials have been updated and moved to
tutorials/modules/incompressibleFluid.

Class
    Foam::solvers::incompressibleFluid

Description
    Solver module for steady or transient turbulent flow of incompressible
    isothermal fluids with optional mesh motion and change.

    Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
    pseudo-transient and steady simulations.

    Optional fvModels and fvConstraints are provided to enhance the simulation
    in many ways including adding various sources, constraining or limiting
    the solution.

    Reference:
    \verbatim
        Greenshields, C. J., & Weller, H. G. (2022).
        Notes on Computational Fluid Dynamics: General Principles.
        CFD Direct Ltd.: Reading, UK.
    \endverbatim

SourceFiles
    incompressibleFluid.C

See also
    Foam::solvers::fluidSolver
    Foam::solvers::isothermalFluid
2022-08-08 22:46:51 +01:00

115 lines
2.4 KiB
Bash
Executable File

#!/bin/sh
usage () {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat <<USAGE
Usage: ${0##*/} [OPTIONS]
options:
-d | -distort distort the mesh
-h | -help help
-p | -pBC <type> set BC for p on the atmosphere patch
-U | -UBC <type> set BC for U on the atmosphere patch
CFD simulation to demonstrate boundary conditions at a patch with mixed inflow
and outflow. The user can set the boundary condition on the atmosphere patch
with options:
+ p: totalPressure (default) or fixedValue
+ U: pressureInletOutletVelocity (default) or zeroGradient
USAGE
exit 1
}
distort () {
wmake distortMesh
runApplication distortMesh
rm 0/meshPhi;
mv 0/polyMesh/points constant/polyMesh
rm -rf 0/polyMesh
}
setAtmosphereBC () {
_field="$1"
_BC="$2"
echo "Setting $_field BC on atmosphere patch to $_BC"
runApplication -a foamDictionary \
-entry boundaryField/atmosphere/type \
-set "$_BC" \
"0/$_field" > /dev/null 2>&1
}
# VARIABLES
distort=""
pBC=""
UBC=""
# OPTIONS
while [ "$#" -gt 0 ]
do
case "$1" in
-d | -distort)
distort="yes"
shift
;;
-h | -help)
usage
;;
-p | -pBC)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
pBC="$2"
shift 2
;;
-U | -UBC)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
UBC="$2"
shift 2
;;
-test)
shift
;;
-*)
usage "Invalid option '$1'"
;;
*)
break
;;
esac
done
case "$pBC" in
totalPressure|fixedValue|"") ;;
*)
usage "Invalid boundary condition '$pBC' for p."\
"Valid options: 'totalPressure', 'fixedValue'."
;;
esac
case "$UBC" in
pressureInletOutletVelocity|zeroGradient|"") ;;
*)
usage "Invalid boundary condition '$UBC' for U."\
"Valid options: 'pressureInletOutletVelocity', 'zeroGradient'."
;;
esac
# Run from this directory
cd "${0%/*}" || exit 1
# Source tutorial run functions
. "$WM_PROJECT_DIR/bin/tools/RunFunctions"
runApplication blockMesh
[ "$distort" ] && distort
runApplication extrudeMesh
[ "$pBC" ] && setAtmosphereBC p "$pBC"
[ "$UBC" ] && setAtmosphereBC U "$UBC"
runApplication "$(getApplication)"
#------------------------------------------------------------------------------