solvers::shockFluid: New solver module for density-based solution of compressible flow
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations. Replaces rhoCentralFoam and all the corresponding
tutorials have been updated and moved to tutorials/modules/shockFluid.
Unlike rhoCentralFoam shockFluid supports mesh refinement/unrefinement, topology
change, run-time mesh-to-mesh mapping, load-balancing in addition to general
mesh-motion.
The tutorials/modules/shockFluid/movingCone case has been updated to demonstrate
run-time mesh-to-mesh mapping mesh topology change based on the
tutorials/modules/incompressibleFluid/movingCone. shockFluid s
Description
Solver module for density-based solution of compressible flow
Based on central-upwind schemes of Kurganov and Tadmor with support for
mesh-motion and topology change.
Reference:
\verbatim
Greenshields, C. J., Weller, H. G., Gasparini, L.,
& Reese, J. M. (2010).
Implementation of semi‐discrete, non‐staggered central schemes
in a colocated, polyhedral, finite volume framework,
for high‐speed viscous flows.
International journal for numerical methods in fluids, 63(1), 1-21.
\endverbatim
SourceFiles
shockFluid.C
See also
Foam::solvers::fluidSolver
Foam::solvers::incompressibleFluid
This commit is contained in:
11
tutorials/modules/fluid/shockTube/Allclean
Executable file
11
tutorials/modules/fluid/shockTube/Allclean
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
|
||||
rm -rf *.eps
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -4,11 +4,10 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application=$(getApplication)
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication setFields
|
||||
runApplication $application
|
||||
runApplication $(getApplication)
|
||||
runApplication -s sample foamPostProcess -func sample
|
||||
./createGraphs
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
49
tutorials/modules/fluid/shockTube/createGraphs
Executable file
49
tutorials/modules/fluid/shockTube/createGraphs
Executable file
@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! which gnuplot > /dev/null 2>&1
|
||||
then
|
||||
echo 'gnuplot not found - skipping graph creation' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
time=$(foamListTimes -latestTime)
|
||||
|
||||
graphFile=postProcessing/sample/$time/data.xy
|
||||
|
||||
gnuplot<<EOF
|
||||
set terminal postscript eps color enhanced font "Helvetica,20"
|
||||
set output 'T.eps'
|
||||
|
||||
set xlabel 'l (m)'
|
||||
set ylabel 'T (K)'
|
||||
set ytics nomirror
|
||||
set key center
|
||||
|
||||
plot "$graphFile" u 1:2 w l t 'T'
|
||||
EOF
|
||||
|
||||
gnuplot<<EOF
|
||||
set terminal postscript eps color enhanced font "Helvetica,20"
|
||||
set output 'U.eps'
|
||||
|
||||
set xlabel 'l (m)'
|
||||
set ylabel 'T (K)'
|
||||
set ytics nomirror
|
||||
set key center
|
||||
|
||||
plot "$graphFile" u 1:3 w l t 'U'
|
||||
EOF
|
||||
|
||||
gnuplot<<EOF
|
||||
set terminal postscript eps color enhanced font "Helvetica,20"
|
||||
set output 'p.eps'
|
||||
|
||||
set xlabel 'l (m)'
|
||||
set ylabel 'p (Pa)'
|
||||
set ytics nomirror
|
||||
set key center
|
||||
|
||||
plot "$graphFile" u 1:4 w l t 'p'
|
||||
EOF
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -14,7 +14,9 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
application foamRun;
|
||||
|
||||
solver shockFluid;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
@ -16,12 +16,12 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
"(rho|rhoU|rhoE)"
|
||||
"(rho|rhoU|rhoE).*"
|
||||
{
|
||||
solver diagonal;
|
||||
}
|
||||
|
||||
U
|
||||
"U.*"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother GaussSeidel;
|
||||
@ -30,7 +30,7 @@ solvers
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
e
|
||||
"e.*"
|
||||
{
|
||||
$U;
|
||||
tolerance 1e-10;
|
||||
@ -38,5 +38,8 @@ solvers
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,30 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "0/uniform";
|
||||
object time;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
beginTime 0;
|
||||
|
||||
value 0;
|
||||
|
||||
name "0";
|
||||
|
||||
index 0;
|
||||
|
||||
deltaT 1e-07;
|
||||
|
||||
deltaT0 1e-07;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
BIN
tutorials/modules/shockFluid/biconic25-55Run35/0/wallHeatFlux
Normal file
BIN
tutorials/modules/shockFluid/biconic25-55Run35/0/wallHeatFlux
Normal file
Binary file not shown.
@ -14,7 +14,9 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
application foamRun;
|
||||
|
||||
solver shockFluid;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
@ -26,7 +28,7 @@ endTime 1e-3;
|
||||
|
||||
deltaT 1e-7;
|
||||
|
||||
writeControl adjustableRunTime;
|
||||
writeControl runTime;
|
||||
|
||||
writeInterval 5e-5;
|
||||
|
||||
@ -44,11 +46,7 @@ timePrecision 6;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
adjustTimeStep yes;
|
||||
|
||||
maxCo 0.5;
|
||||
|
||||
maxDeltaT 2e-8;
|
||||
adjustTimeStep no;
|
||||
|
||||
functions
|
||||
{
|
||||
@ -16,12 +16,12 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
"(rho|rhoU|rhoE)"
|
||||
"(rho|rhoU|rhoE).*"
|
||||
{
|
||||
solver diagonal;
|
||||
}
|
||||
|
||||
U
|
||||
"U.*"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother GaussSeidel;
|
||||
@ -30,12 +30,18 @@ solvers
|
||||
relTol 0.01;
|
||||
}
|
||||
|
||||
e
|
||||
"e.*"
|
||||
{
|
||||
$U;
|
||||
relTol 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{
|
||||
maxCo 0.5;
|
||||
maxDeltaT 2e-8;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -14,7 +14,9 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
application foamRun;
|
||||
|
||||
solver shockFluid;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
@ -16,12 +16,12 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
"(rho|rhoU|rhoE)"
|
||||
"(rho|rhoU|rhoE).*"
|
||||
{
|
||||
solver diagonal;
|
||||
}
|
||||
|
||||
U
|
||||
"U.*"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother GaussSeidel;
|
||||
@ -30,7 +30,7 @@ solvers
|
||||
relTol 0.01;
|
||||
}
|
||||
|
||||
h
|
||||
"e.*"
|
||||
{
|
||||
$U;
|
||||
tolerance 1e-10;
|
||||
@ -38,5 +38,8 @@ solvers
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -19,6 +19,8 @@ internalField uniform 300;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
movingWall
|
||||
{
|
||||
type zeroGradient;
|
||||
@ -44,16 +46,6 @@ boundaryField
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
back
|
||||
{
|
||||
type wedge;
|
||||
}
|
||||
|
||||
front
|
||||
{
|
||||
type wedge;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -19,6 +19,8 @@ internalField uniform (0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
movingWall
|
||||
{
|
||||
type movingWallVelocity;
|
||||
@ -45,16 +47,6 @@ boundaryField
|
||||
{
|
||||
type noSlip;
|
||||
}
|
||||
|
||||
back
|
||||
{
|
||||
type wedge;
|
||||
}
|
||||
|
||||
front
|
||||
{
|
||||
type wedge;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -19,6 +19,8 @@ internalField uniform 1e5;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
movingWall
|
||||
{
|
||||
type zeroGradient;
|
||||
@ -44,16 +46,6 @@ boundaryField
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
back
|
||||
{
|
||||
type wedge;
|
||||
}
|
||||
|
||||
front
|
||||
{
|
||||
type wedge;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -19,16 +19,18 @@ internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
movingWall
|
||||
{
|
||||
type uniformFixedValue;
|
||||
uniformValue constant 160;
|
||||
uniformValue constant 150;
|
||||
}
|
||||
|
||||
farFieldMoving
|
||||
{
|
||||
type uniformFixedValue;
|
||||
uniformValue constant 160;
|
||||
uniformValue constant 150;
|
||||
}
|
||||
|
||||
fixedWall
|
||||
@ -47,16 +49,6 @@ boundaryField
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
|
||||
back
|
||||
{
|
||||
type wedge;
|
||||
}
|
||||
|
||||
front
|
||||
{
|
||||
type wedge;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
11
tutorials/modules/shockFluid/movingCone/Allclean
Executable file
11
tutorials/modules/shockFluid/movingCone/Allclean
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
rm -rf constant/meshToMesh*
|
||||
|
||||
cleanCase
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
25
tutorials/modules/shockFluid/movingCone/Allrun
Executable file
25
tutorials/modules/shockFluid/movingCone/Allrun
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application=$(getApplication)
|
||||
|
||||
mapTimes="1e-05 2e-05"
|
||||
|
||||
# Iterate the string variable using for loop
|
||||
for mapTime in $mapTimes; do
|
||||
|
||||
runApplication -a blockMesh -dict blockMeshDict_$mapTime
|
||||
rm -rf constant/meshToMesh_$mapTime
|
||||
mkdir constant/meshToMesh_$mapTime
|
||||
mv constant/polyMesh constant/meshToMesh_$mapTime
|
||||
|
||||
done
|
||||
|
||||
runApplication -a blockMesh
|
||||
|
||||
runApplication $application
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
43
tutorials/modules/shockFluid/movingCone/Allrun-parallel
Executable file
43
tutorials/modules/shockFluid/movingCone/Allrun-parallel
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
mapTimes="1e-05 2e-05"
|
||||
|
||||
# Iterate the string variable using for loop
|
||||
for mapTime in $mapTimes; do
|
||||
|
||||
runApplication -a blockMesh -dict blockMeshDict_$mapTime
|
||||
runApplication -a decomposePar -force -noFields -dict decomposeParDict_$mapTime
|
||||
|
||||
rm -rf constant/meshToMesh_$mapTime
|
||||
mkdir constant/meshToMesh_$mapTime
|
||||
|
||||
for procI in processor*
|
||||
do
|
||||
mv $procI/constant/polyMesh constant/meshToMesh_$mapTime/$procI
|
||||
done
|
||||
|
||||
mv constant/polyMesh constant/meshToMesh_$mapTime
|
||||
|
||||
done
|
||||
|
||||
runApplication -a blockMesh -dict blockMeshDict
|
||||
runApplication -a decomposePar -force
|
||||
|
||||
for mapTime in $mapTimes; do
|
||||
|
||||
for procI in processor*
|
||||
do
|
||||
mkdir $procI/constant/meshToMesh_$mapTime
|
||||
mv constant/meshToMesh_$mapTime/$procI $procI/constant/meshToMesh_$mapTime/polyMesh
|
||||
done
|
||||
|
||||
done
|
||||
|
||||
runParallel $(getApplication)
|
||||
runApplication reconstructPar
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
52
tutorials/modules/shockFluid/movingCone/U
Normal file
52
tutorials/modules/shockFluid/movingCone/U
Normal file
@ -0,0 +1,52 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volVectorField;
|
||||
object U;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
movingWall
|
||||
{
|
||||
type movingWallVelocity;
|
||||
value $internalField;
|
||||
}
|
||||
|
||||
farFieldMoving
|
||||
{
|
||||
type noSlip;
|
||||
}
|
||||
|
||||
fixedWall
|
||||
{
|
||||
type noSlip;
|
||||
}
|
||||
|
||||
left
|
||||
{
|
||||
type pressureInletOutletVelocity;
|
||||
value $internalField;
|
||||
}
|
||||
|
||||
farField
|
||||
{
|
||||
type noSlip;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -27,4 +27,16 @@ mover
|
||||
}
|
||||
|
||||
|
||||
topoChanger
|
||||
{
|
||||
type meshToMesh;
|
||||
|
||||
libs ("libmeshToMeshTopoChanger.so");
|
||||
|
||||
times (1e-5 2e-5);
|
||||
|
||||
timeDelta 1e-9;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
54
tutorials/modules/shockFluid/movingCone/pointMotionUx
Normal file
54
tutorials/modules/shockFluid/movingCone/pointMotionUx
Normal file
@ -0,0 +1,54 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class pointScalarField;
|
||||
object pointMotionUx;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
|
||||
movingWall
|
||||
{
|
||||
type uniformFixedValue;
|
||||
uniformValue constant 1;
|
||||
}
|
||||
|
||||
farFieldMoving
|
||||
{
|
||||
type uniformFixedValue;
|
||||
uniformValue constant 1;
|
||||
}
|
||||
|
||||
fixedWall
|
||||
{
|
||||
type uniformFixedValue;
|
||||
uniformValue constant 0;
|
||||
}
|
||||
|
||||
left
|
||||
{
|
||||
type uniformFixedValue;
|
||||
uniformValue constant 0;
|
||||
}
|
||||
|
||||
farField
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -41,15 +41,20 @@ vertices
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 5 4 0 1 13 12) (15 15 1) simpleGrading (1 1 1)
|
||||
hex (0 1 5 4 0 1 13 12) (8 15 1) simpleGrading (1 1 1)
|
||||
hex (2 3 7 6 2 3 15 14) (20 20 1) simpleGrading (2 0.25 1)
|
||||
hex (4 5 9 8 12 13 17 16) (15 15 1) simpleGrading (1 1 1)
|
||||
hex (4 5 9 8 12 13 17 16) (8 15 1) simpleGrading (1 1 1)
|
||||
hex (5 6 10 9 13 14 18 17) (50 15 1) simpleGrading (1 1 1)
|
||||
hex (6 7 11 10 14 15 19 18) (20 15 1) simpleGrading (2 1 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
internal
|
||||
{
|
||||
type internal;
|
||||
faces ();
|
||||
}
|
||||
movingWall
|
||||
{
|
||||
type wall;
|
||||
@ -0,0 +1,139 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
convertToMeters 0.001;
|
||||
|
||||
vertices
|
||||
(
|
||||
(-7.5 0 0)
|
||||
(-5.5 0 0)
|
||||
(-2 0 0)
|
||||
(0 0 0)
|
||||
(-7.5 0.75 -0.03271454)
|
||||
(-5.5 0.75 -0.03271454)
|
||||
(-2 2 -0.087238774)
|
||||
(0 2 -0.087238774)
|
||||
(-7.5 2.5 -0.10904846)
|
||||
(-5.5 2.5 -0.10904846)
|
||||
(-2 2.5 -0.10904846)
|
||||
(0 2.5 -0.10904846)
|
||||
(-7.5 0.75 0.03271454)
|
||||
(-5.5 0.75 0.03271454)
|
||||
(-2 2 0.087238774)
|
||||
(0 2 0.087238774)
|
||||
(-7.5 2.5 0.10904846)
|
||||
(-5.5 2.5 0.10904846)
|
||||
(-2 2.5 0.10904846)
|
||||
(0 2.5 0.10904846)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 5 4 0 1 13 12) (16 15 1) simpleGrading (1 1 1)
|
||||
hex (2 3 7 6 2 3 15 14) (10 20 1) simpleGrading (2 0.25 1)
|
||||
hex (4 5 9 8 12 13 17 16) (16 15 1) simpleGrading (1 1 1)
|
||||
hex (5 6 10 9 13 14 18 17) (50 15 1) simpleGrading (1 1 1)
|
||||
hex (6 7 11 10 14 15 19 18) (10 15 1) simpleGrading (2 1 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
internal
|
||||
{
|
||||
type internal;
|
||||
faces ();
|
||||
}
|
||||
movingWall
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 5 13 1)
|
||||
(5 6 14 13)
|
||||
(2 2 14 6)
|
||||
);
|
||||
}
|
||||
farFieldMoving
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(9 17 18 10)
|
||||
);
|
||||
}
|
||||
fixedWall
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(3 7 15 3)
|
||||
(7 11 19 15)
|
||||
);
|
||||
}
|
||||
axis
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 1 1 0)
|
||||
(2 3 3 2)
|
||||
);
|
||||
}
|
||||
left
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 0 12 4)
|
||||
(4 12 16 8)
|
||||
);
|
||||
}
|
||||
farField
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(8 16 17 9)
|
||||
(10 18 19 11)
|
||||
);
|
||||
}
|
||||
back
|
||||
{
|
||||
type wedge;
|
||||
faces
|
||||
(
|
||||
(0 4 5 1)
|
||||
(2 6 7 3)
|
||||
(4 8 9 5)
|
||||
(5 9 10 6)
|
||||
(6 10 11 7)
|
||||
);
|
||||
}
|
||||
front
|
||||
{
|
||||
type wedge;
|
||||
faces
|
||||
(
|
||||
(0 1 13 12)
|
||||
(2 3 15 14)
|
||||
(12 13 17 16)
|
||||
(13 14 18 17)
|
||||
(14 15 19 18)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,139 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
convertToMeters 0.001;
|
||||
|
||||
vertices
|
||||
(
|
||||
(-7.5 0 0)
|
||||
(-4 0 0)
|
||||
(-0.5 0 0)
|
||||
(0 0 0)
|
||||
(-7.5 0.75 -0.03271454)
|
||||
(-4 0.75 -0.03271454)
|
||||
(-0.5 2 -0.087238774)
|
||||
(0 2 -0.087238774)
|
||||
(-7.5 2.5 -0.10904846)
|
||||
(-4 2.5 -0.10904846)
|
||||
(-0.5 2.5 -0.10904846)
|
||||
(0 2.5 -0.10904846)
|
||||
(-7.5 0.75 0.03271454)
|
||||
(-4 0.75 0.03271454)
|
||||
(-0.5 2 0.087238774)
|
||||
(0 2 0.087238774)
|
||||
(-7.5 2.5 0.10904846)
|
||||
(-4 2.5 0.10904846)
|
||||
(-0.5 2.5 0.10904846)
|
||||
(0 2.5 0.10904846)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 5 4 0 1 13 12) (25 15 1) simpleGrading (1 1 1)
|
||||
hex (2 3 7 6 2 3 15 14) (5 20 1) simpleGrading (2 0.25 1)
|
||||
hex (4 5 9 8 12 13 17 16) (25 15 1) simpleGrading (1 1 1)
|
||||
hex (5 6 10 9 13 14 18 17) (50 15 1) simpleGrading (1 1 1)
|
||||
hex (6 7 11 10 14 15 19 18) (5 15 1) simpleGrading (2 1 1)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
internal
|
||||
{
|
||||
type internal;
|
||||
faces ();
|
||||
}
|
||||
movingWall
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(1 5 13 1)
|
||||
(5 6 14 13)
|
||||
(2 2 14 6)
|
||||
);
|
||||
}
|
||||
farFieldMoving
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(9 17 18 10)
|
||||
);
|
||||
}
|
||||
fixedWall
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(3 7 15 3)
|
||||
(7 11 19 15)
|
||||
);
|
||||
}
|
||||
axis
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 1 1 0)
|
||||
(2 3 3 2)
|
||||
);
|
||||
}
|
||||
left
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 0 12 4)
|
||||
(4 12 16 8)
|
||||
);
|
||||
}
|
||||
farField
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(8 16 17 9)
|
||||
(10 18 19 11)
|
||||
);
|
||||
}
|
||||
back
|
||||
{
|
||||
type wedge;
|
||||
faces
|
||||
(
|
||||
(0 4 5 1)
|
||||
(2 6 7 3)
|
||||
(4 8 9 5)
|
||||
(5 9 10 6)
|
||||
(6 10 11 7)
|
||||
);
|
||||
}
|
||||
front
|
||||
{
|
||||
type wedge;
|
||||
faces
|
||||
(
|
||||
(0 1 13 12)
|
||||
(2 3 15 14)
|
||||
(12 13 17 16)
|
||||
(13 14 18 17)
|
||||
(14 15 19 18)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -14,7 +14,9 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
application foamRun;
|
||||
|
||||
solver shockFluid;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object decomposeParDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 4;
|
||||
|
||||
method hierarchical;
|
||||
|
||||
simpleCoeffs
|
||||
{
|
||||
n (2 1 1);
|
||||
}
|
||||
|
||||
hierarchicalCoeffs
|
||||
{
|
||||
n (4 1 1);
|
||||
order xyz;
|
||||
}
|
||||
|
||||
manualCoeffs
|
||||
{
|
||||
dataFile "";
|
||||
}
|
||||
|
||||
distributed no;
|
||||
|
||||
roots ( );
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,42 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object decomposeParDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 4;
|
||||
|
||||
method scotch;
|
||||
|
||||
simpleCoeffs
|
||||
{
|
||||
n (2 1 1);
|
||||
}
|
||||
|
||||
hierarchicalCoeffs
|
||||
{
|
||||
n (4 1 1);
|
||||
order xyz;
|
||||
}
|
||||
|
||||
manualCoeffs
|
||||
{
|
||||
dataFile "";
|
||||
}
|
||||
|
||||
distributed no;
|
||||
|
||||
roots ( );
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,42 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object decomposeParDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 4;
|
||||
|
||||
method hierarchical;
|
||||
|
||||
simpleCoeffs
|
||||
{
|
||||
n (2 1 1);
|
||||
}
|
||||
|
||||
hierarchicalCoeffs
|
||||
{
|
||||
n (2 2 1);
|
||||
order xyz;
|
||||
}
|
||||
|
||||
manualCoeffs
|
||||
{
|
||||
dataFile "";
|
||||
}
|
||||
|
||||
distributed no;
|
||||
|
||||
roots ( );
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -59,7 +59,7 @@ solvers
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
cellMotionUx
|
||||
"cellMotionUx.*"
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
@ -72,7 +72,7 @@ PIMPLE
|
||||
{
|
||||
momentumPredictor yes;
|
||||
correctPhi yes;
|
||||
nOuterCorrectors 2;
|
||||
nOuterCorrectors 1;
|
||||
nCorrectors 2;
|
||||
transonic yes;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
@ -14,7 +14,9 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
application foamRun;
|
||||
|
||||
solver shockFluid;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
@ -16,12 +16,12 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
"(rho|rhoU|rhoE)"
|
||||
"(rho|rhoU|rhoE).*"
|
||||
{
|
||||
solver diagonal;
|
||||
}
|
||||
|
||||
U
|
||||
"U.*"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother GaussSeidel;
|
||||
@ -30,7 +30,7 @@ solvers
|
||||
relTol 0.01;
|
||||
}
|
||||
|
||||
h
|
||||
"e.*"
|
||||
{
|
||||
$U;
|
||||
tolerance 1e-10;
|
||||
@ -38,5 +38,8 @@ solvers
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
35
tutorials/modules/shockFluid/shockTube/0/mag(U)
Normal file
35
tutorials/modules/shockFluid/shockTube/0/mag(U)
Normal file
@ -0,0 +1,35 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object mag(U);
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
sides
|
||||
{
|
||||
type calculated;
|
||||
value uniform 0;
|
||||
}
|
||||
empty
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
11
tutorials/modules/shockFluid/shockTube/Allclean
Executable file
11
tutorials/modules/shockFluid/shockTube/Allclean
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
|
||||
rm -rf *.eps
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -8,5 +8,6 @@ runApplication blockMesh
|
||||
runApplication setFields
|
||||
runApplication $(getApplication)
|
||||
runApplication -s sample foamPostProcess -func sample
|
||||
./createGraphs
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
49
tutorials/modules/shockFluid/shockTube/createGraphs
Executable file
49
tutorials/modules/shockFluid/shockTube/createGraphs
Executable file
@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! which gnuplot > /dev/null 2>&1
|
||||
then
|
||||
echo 'gnuplot not found - skipping graph creation' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
time=$(foamListTimes -latestTime)
|
||||
|
||||
graphFile=postProcessing/sample/$time/data.xy
|
||||
|
||||
gnuplot<<EOF
|
||||
set terminal postscript eps color enhanced font "Helvetica,20"
|
||||
set output 'T.eps'
|
||||
|
||||
set xlabel 'l (m)'
|
||||
set ylabel 'T (K)'
|
||||
set ytics nomirror
|
||||
set key center
|
||||
|
||||
plot "$graphFile" u 1:2 w l t 'T'
|
||||
EOF
|
||||
|
||||
gnuplot<<EOF
|
||||
set terminal postscript eps color enhanced font "Helvetica,20"
|
||||
set output 'U.eps'
|
||||
|
||||
set xlabel 'l (m)'
|
||||
set ylabel 'T (K)'
|
||||
set ytics nomirror
|
||||
set key center
|
||||
|
||||
plot "$graphFile" u 1:3 w l t 'U'
|
||||
EOF
|
||||
|
||||
gnuplot<<EOF
|
||||
set terminal postscript eps color enhanced font "Helvetica,20"
|
||||
set output 'p.eps'
|
||||
|
||||
set xlabel 'l (m)'
|
||||
set ylabel 'p (Pa)'
|
||||
set ytics nomirror
|
||||
set key center
|
||||
|
||||
plot "$graphFile" u 1:4 w l t 'p'
|
||||
EOF
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -14,7 +14,9 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
application foamRun;
|
||||
|
||||
solver shockFluid;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
@ -16,12 +16,12 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
"(rho|rhoU|rhoE)"
|
||||
"(rho|rhoU|rhoE).*"
|
||||
{
|
||||
solver diagonal;
|
||||
}
|
||||
|
||||
U
|
||||
"U.*"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother GaussSeidel;
|
||||
@ -30,7 +30,7 @@ solvers
|
||||
relTol 0.01;
|
||||
}
|
||||
|
||||
h
|
||||
"e.*"
|
||||
{
|
||||
$U;
|
||||
tolerance 1e-10;
|
||||
@ -38,5 +38,8 @@ solvers
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -14,7 +14,9 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application rhoCentralFoam;
|
||||
application foamRun;
|
||||
|
||||
solver shockFluid;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
@ -16,12 +16,12 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
"(rho|rhoU|rhoE)"
|
||||
"(rho|rhoU|rhoE).*"
|
||||
{
|
||||
solver diagonal;
|
||||
}
|
||||
|
||||
U
|
||||
"U.*"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother GaussSeidel;
|
||||
@ -30,7 +30,7 @@ solvers
|
||||
relTol 0.01;
|
||||
}
|
||||
|
||||
h
|
||||
"h.*"
|
||||
{
|
||||
$U;
|
||||
tolerance 1e-10;
|
||||
@ -38,5 +38,8 @@ solvers
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user