Skip to content
Snippets Groups Projects
Commit 5577458f authored by Chris Greenshields's avatar Chris Greenshields
Browse files

Modified waterChannel tutorial to make case better posed

Existing case did not properly converge and suffered slow convergence
with the water level failing to reach an equilibrium.  A slight rise in
the channel appears to help the water level reach an equlibrium when the flow
rate over the rise matches the inlet flow rate.
parent 9f3b1700
No related merge requests found
Showing
with 27 additions and 307 deletions
...@@ -16,7 +16,7 @@ FoamFile ...@@ -16,7 +16,7 @@ FoamFile
dimensions [0 1 -1 0 0 0 0]; dimensions [0 1 -1 0 0 0 0];
internalField uniform (2 0 0); internalField uniform (1 0 0);
boundaryField boundaryField
{ {
......
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
application=`getApplication`
runApplication blockMesh
echo "Creating channel"
i=1
while [ "$i" -lt 3 ] ; do
cp system/extrudeMeshDict.${i} system/extrudeMeshDict
echo "Running extrudeMesh, instance" ${i}
extrudeMesh > log.extrudeMesh.${i}
i=`expr $i + 1`
done
# ----------------------------------------------------------------- end-of-file
...@@ -6,16 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -6,16 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory
application=`getApplication` application=`getApplication`
runApplication blockMesh ./Allmesh
echo "Creating channel"
i=1
while [ "$i" -lt 3 ] ; do
cp system/extrudeMeshDict.${i} system/extrudeMeshDict
echo "Running extrudeMesh, instance" ${i}
extrudeMesh > log.extrudeMesh.${i}
i=`expr $i + 1`
done
cp 0/alpha.water.org 0/alpha.water cp 0/alpha.water.org 0/alpha.water
runApplication setFields runApplication setFields
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application LTSInterFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 5000;
deltaT 1;
writeControl timeStep;
writeInterval 200;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression compressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.5;
maxAlphaCo 0.5;
maxDeltaT 1;
functions
{
inletFlux
{
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
outputControl timeStep;
log true;
// Output field values as well
valueOutput false;
source patch;
sourceName inlet;
operation sum;
fields
(
rhoPhi
);
}
outletFlux
{
$inletFlux;
sourceName outlet;
}
atmosphereFlux
{
$inletFlux;
sourceName atmosphere;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default localEuler rDeltaT;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(rhoPhi,U) Gauss linearUpwind grad(U);
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss linear;
div(phi,k) Gauss upwind;
div(phi,omega) Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p_rgh;
pcorr;
alpha.water;
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
alpha.water
{
nAlphaCorr 1;
nAlphaSubCycles 3;
cAlpha 1;
}
pcorr
{
solver PCG;
preconditioner
{
preconditioner GAMG;
tolerance 1e-05;
relTol 0;
smoother DICGaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
tolerance 1e-05;
relTol 0;
maxIter 100;
}
p_rgh
{
$pcorr;
tolerance 1e-6;
relTol 0.01;
};
p_rghFinal
{
$p_rgh;
tolerance 1e-6;
relTol 0;
}
"(U|k|omega).*"
{
solver smoothSolver;
smoother GaussSeidel;
nSweeps 1;
tolerance 1e-7;
relTol 0.1;
};
}
PIMPLE
{
momentumPredictor no;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
maxCo 0.5;
maxAlphaCo 0.2;
nAlphaSweepIter 1;
rDeltaTSmoothingCoeff 0.1;
rDeltaTDampingCoeff 1;
maxDeltaT 100;
}
relaxationFactors
{
equations
{
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha.water 0
);
regions
(
boxToCell
{
box (0 0 0) (50 130 27);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
boxToFace
{
box (0 0 0) (50 10.0001 24);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
);
// ************************************************************************* //
- This case uses blockMesh and extrudeMesh to create a channel geometry. - This case uses blockMesh and extrudeMesh to create a channel geometry.
- See Allrun script to generate geometry. - See Allmesh script to generate geometry.
- The case is set up to run with interFoam. - The case is set up to run with interFoam.
- For running with LTSInterFoam, an alternative set of main files from - For running with LTSInterFoam, an alternative set of main files from
system directory (controlDict, etc) are included in LTSInterFoam system directory (controlDict, etc) are included in LTSInterFoam
......
...@@ -23,7 +23,7 @@ startTime 0; ...@@ -23,7 +23,7 @@ startTime 0;
stopAt endTime; stopAt endTime;
endTime 100; endTime 200;
deltaT 0.1; deltaT 0.1;
......
...@@ -28,7 +28,7 @@ expansionRatio 1.0; ...@@ -28,7 +28,7 @@ expansionRatio 1.0;
linearDirectionCoeffs linearDirectionCoeffs
{ {
axisPt (0 0 0); axisPt (0 0 0);
direction (1 0.2 -0.02); direction (1 0.2 0.02);
thickness 60; thickness 60;
} }
......
...@@ -28,7 +28,7 @@ expansionRatio 1.0; ...@@ -28,7 +28,7 @@ expansionRatio 1.0;
linearDirectionCoeffs linearDirectionCoeffs
{ {
axisPt (0 0 0); axisPt (0 0 0);
direction (1 -0.2 -0.02); direction (1 -0.2 -0.03);
thickness 40; thickness 40;
} }
......
...@@ -24,7 +24,7 @@ regions ...@@ -24,7 +24,7 @@ regions
( (
boxToCell boxToCell
{ {
box (-10 -20 -10) (200 20 4); box (-10 -20 -10) (50 20 2.2);
fieldValues fieldValues
( (
volScalarFieldValue alpha.water 1 volScalarFieldValue alpha.water 1
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment