Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

This commit is contained in:
sergio
2018-10-17 10:29:34 -07:00
736 changed files with 10759 additions and 8147 deletions

8
tutorials/Allcollect Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/LogFunctions # Tutorial log-file functions
# Collect log files as 'testLoopReport'
collectLogs
#------------------------------------------------------------------------------

View File

@ -4,7 +4,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
# \\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
@ -28,12 +28,15 @@ usage()
usage: ${0##*/} [OPTION]
options:
-git use git to retrieve the tutorials
-root dir specify root directory to run tests from
-default sets up a default scheme on all schemes
-help print the usage
-git Use git to retrieve the tutorials
-no-git Do not use git to retrieve the tutorials
-root dir Specify root directory to run tests from
-default Sets up a default scheme on all schemes
-help Print the usage
* quickly tests the tutorials and writes out the scheme/solver information
Quickly tests the tutorials and writes out the scheme/solver information.
The default is to detect and use 'git' if possible to obtain a fresh set
of tutorial files. This can be overridden with -git or -no-git options.
USAGE
exit 1
@ -56,9 +59,9 @@ die()
ROOT="./"
unset DEFAULT_SCHEMES
unset useGit
useGit=auto
# parse options
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
@ -66,24 +69,27 @@ do
usage
;;
-r | -root)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
ROOT="$2"
shift
;;
-git)
useGit=true
;;
-no-git)
unset useGit
;;
-d | -default)
DEFAULT_SCHEMES=true
;;
*)
usage "unknown option/argument: '$1'"
die "Unknown option/argument: '$1'"
;;
esac
shift
done
# Set tutorial locations (as required)
# Set FOAM_TUTORIALS directory location, as required.
. $WM_PROJECT_DIR/bin/tools/RunFunctions
@ -120,6 +126,7 @@ snGradSchemes { default corrected; }
EOF
}
#
# Location of the main controlDict
#
@ -138,7 +145,7 @@ do
fi
done
[ -f "$MAIN_CONTROL_DICT" ] || usage "main controlDict not found"
[ -f "$MAIN_CONTROL_DICT" ] || usage "Main controlDict not found"
TUTORIALS_DIR=$ROOT
@ -168,59 +175,85 @@ then
fi
# Remove old build/ directory
buildDir="$WM_PROJECT_DIR/build/${WM_OPTIONS}/${TEST_RUN_DIR##*/}"
buildDir="$WM_PROJECT_DIR/build/$WM_OPTIONS/${TEST_RUN_DIR##*/}"
if [ -d "$buildDir" ]
then
echo "Removing old build directory: $buildDir" 1>&2
rm -rf $buildDir
fi
echo "Modifying ${MAIN_CONTROL_DICT}" 1>&2
if [ -e ${MAIN_CONTROL_DICT}.orig ]
then
die "File ${MAIN_CONTROL_DICT}.orig already exists" \
"Did Alltest fail in some way and then run again?"
fi
unset gitbase
if [ -n "$useGit" ]
then
if git rev-parse --is-inside-work-tree > /dev/null 2>&1
then
gitbase="$(git rev-parse --show-toplevel 2>/dev/null)"
fi
case "$useGit" in
auto)
if [ -n "$gitbase" ]
then
echo "Detected git repository" 1>&2
else
echo "No git repository detected" 1>&2
fi
;;
true)
[ -n "$gitbase" ] || die "Not in a git repository"
;;
esac
fi
if [ -n "$gitbase" ]
then
echo "Copying the tutorials from current git branch" 1>&2
mkdir -p ${TEST_RUN_DIR}
( cd "$gitbase/tutorials" && git archive --format=tar HEAD . ) | \
( cd "$TEST_RUN_DIR" && tar -xf - )
else
echo "Copying the tutorials directory" 1>&2
cp -a "$TUTORIALS_DIR" "$TEST_RUN_DIR"
fi
echo 1>&2
# Clean up on termination and on Ctrl-C
trap 'mv ${MAIN_CONTROL_DICT}.orig ${MAIN_CONTROL_DICT} 2>/dev/null; exit 0' \
EXIT TERM INT
cp ${MAIN_CONTROL_DICT} ${MAIN_CONTROL_DICT}.orig
cp -f "${MAIN_CONTROL_DICT}" "${MAIN_CONTROL_DICT}.orig"
echo "Modifying ${MAIN_CONTROL_DICT}" 1>&2
sed \
-e s/"\(fvSchemes[ \t]*\)\([0-9]\);"/"\1 1;"/g \
-e s/"\(solution[ \t]*\)\([0-9]\);"/"\1 1;"/g \
${MAIN_CONTROL_DICT}.orig > ${MAIN_CONTROL_DICT}
"${MAIN_CONTROL_DICT}.orig" > "${MAIN_CONTROL_DICT}"
if [ -n "$useGit" ]
then
echo "Copying the tutorials from current git branch" 1>&2
if git rev-parse --is-inside-work-tree > /dev/null 2>&1 && \
base="$(git rev-parse --show-toplevel 2>/dev/null)"
then
mkdir -p ${TEST_RUN_DIR}
( cd $base/tutorials && git archive --format=tar HEAD . ) | \
( cd $TEST_RUN_DIR && tar -xf - )
else
die "Not in a git-repo"
fi
else
echo "Copying the tutorials" 1>&2
cp -a ${TUTORIALS_DIR} ${TEST_RUN_DIR}
fi
cd "${TEST_RUN_DIR}" || exit 1
echo "Modifying the controlDicts to run only one time step" 1>&2
cd ${TEST_RUN_DIR} || exit 1
for CD in $(find . -name "controlDict*" -type f)
do
mv ${CD} ${CD}.orig
cp -f "${CD}" "${CD}.orig"
sed \
-e s/"\(startFrom[ \t]*\)\([a-zA-Z]*\);"/"\1 latestTime;"/g \
-e s/"\(stopAt[ \t]*\)\([a-zA-Z]*\);"/"\1 nextWrite;"/g \
-e s/"\(writeControl[ \t]*\)\([a-zA-Z]*\);"/"\1 timeStep;"/g \
-e s/"\(writeInterval[ \t]*\)\([0-9a-zA-Z.-]*\);"/"\1 1;"/g \
${CD}.orig > ${CD}
"${CD}.orig" > "${CD}"
done
if [ "$DEFAULT_SCHEMES" = true ]
@ -230,10 +263,10 @@ then
do
for S in $FV_SCHEMES
do
mv ${FV_SC} ${FV_SC}.orig
sed -e /"${S}"/,/$p/d ${FV_SC}.orig > ${FV_SC}
cp -f "${FV_SC}" "${FV_SC}.orig"
sed -e /"${S}"/,/$p/d "${FV_SC}.orig" > "${FV_SC}"
done
setDefaultFvSchemes >> ${FV_SC}
setDefaultFvSchemes >> "${FV_SC}"
done
fi

View File

@ -33,7 +33,7 @@ boundaryField
uniformValue table
(
(0.0 (0 0 0))
(1.0 (0.31 0 0))
(1.0 (0.2 0 0))
(2.0 (0 0 0))
);
}

View File

@ -38,8 +38,7 @@ functions
scalar gamma = 1.4;
scalar A = -0.3*D*UInf;
const dimensionedScalar rhoRef("rhoRef", dimDensity, 1);
const volScalarField& rho =
mesh().lookupObject<volScalarField>("rho");
const auto& rho = mesh().lookupObject<volScalarField>("rho");
const vectorField& C = mesh().C();
const scalarField x(C.component(0));
@ -47,19 +46,15 @@ functions
const scalar r2 = sqr(0.5*D/(Foam::sqrt(Foam::log(10.0))));
const scalarField Psi(A*exp(-0.5/r2*(sqr(x) + sqr(y))));
volVectorField* Uptr =
mesh().lookupObjectRefPtr<volVectorField>("U");
volScalarField* pPtr =
mesh().lookupObjectRefPtr<volScalarField>("p");
volScalarField* TPtr =
mesh().lookupObjectRefPtr<volScalarField>("T");
auto* Uptr = mesh().getObjectPtr<volVectorField>("U");
auto* pPtr = mesh().getObjectPtr<volScalarField>("p");
auto* TPtr = mesh().getObjectPtr<volScalarField>("T");
if (Uptr && pPtr && TPtr)
{
volVectorField& U = *Uptr;
volScalarField& p = *pPtr;
volScalarField& T = *TPtr;
auto& U = *Uptr;
auto& p = *pPtr;
auto& T = *TPtr;
vectorField& Uc = U.primitiveFieldRef();
Uc.replace(0, UInf - rhoRef/rho()*Psi/r2*y);

View File

@ -31,14 +31,9 @@ porosity1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (0.70710678 0.70710678 0);
e3 (0 0 1);
}
e1 (0.70710678 0.70710678 0);
e3 (0 0 1);
}
}
}

View File

@ -31,14 +31,9 @@ porosity1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
}
}

View File

@ -22,6 +22,7 @@ porosity1
explicitPorositySourceCoeffs
{
selectionMode cellZone;
cellZone stator;
type DarcyForchheimer;
@ -31,13 +32,11 @@ porosity1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
rotation
{
type axesRotation;
e1 (1 0 0);
e2 (0 1 0);
type none;
}
}
}

View File

@ -26,14 +26,9 @@ porosity1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
}

View File

@ -35,14 +35,9 @@ porosity
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
}
}

View File

@ -54,17 +54,9 @@ geometry
scale (1.0 1.0 2.1);
transform
{
coordinateSystem
{
type cartesian;
origin (2 2 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e3 (0 0 1);
}
}
origin (2 2 0);
e1 (1 0 0);
e3 (0 0 1);
}
}
herring
@ -73,17 +65,9 @@ geometry
scale (1.0 1.0 2.1);
transform
{
coordinateSystem
{
type cartesian;
origin (3.5 3 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e3 (0 0 1);
}
}
origin (3.5 3 0);
e1 (1 0 0);
e3 (0 0 1);
}
}
}
@ -121,7 +105,6 @@ castellatedMeshControls
nCellsBetweenLevels 1;
// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -136,7 +119,6 @@ castellatedMeshControls
);
// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -44,14 +44,9 @@ porosityBlockage
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (0 1 0);
e2 (0 0 1);
}
e1 (0 1 0);
e2 (0 0 1);
}
}
}

View File

@ -22,6 +22,7 @@ porosity1
explicitPorositySourceCoeffs
{
selectionMode cellZone;
cellZone porousBlockage;
type DarcyForchheimer;
@ -36,13 +37,11 @@ porosity1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
rotation
{
type axesRotation;
e1 (1 0 0);
e2 (0 1 0);
type none;
}
}
}

View File

@ -26,14 +26,9 @@ porosity1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
}

View File

@ -26,14 +26,9 @@ porosity1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0); //(0.70710678 0.70710678 0);
e2 (0 0 1);
}
e1 (1 0 0);
e2 (0 1 0);
}
}

View File

@ -33,14 +33,9 @@ porosity1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e2 (0 1 0);
}
origin (0 0 0);
e1 (1 0 0);
e2 (0 1 0);
}
}
}

View File

@ -54,6 +54,7 @@ maxDeltaT 1;
functions
{
#include "vtkCloud"
// #include "dataCloud"
#include "runTimePostProcessing"
}

View File

@ -0,0 +1,13 @@
// -*- C++ -*-
// Minimal example of using the dataCloud function object.
dataCloud
{
type dataCloud;
libs ("liblagrangianFunctionObjects.so");
log true;
cloud coalCloud1;
field d;
}
// ************************************************************************* //

View File

@ -31,14 +31,9 @@ filter1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e2 (0 1 0);
}
e1 (1 0 0);
e2 (0 1 0);
}
}
}

View File

@ -51,5 +51,18 @@ maxCo 0.3;
maxDeltaT 1e-03;
functions
{
fieldExtents
{
type fieldExtents;
libs ("libfieldFunctionObjects.so");
region wallFilmRegion;
threshold 0.5;
fields (alpha);
internalField yes;
patches ();
}
}
// ************************************************************************* //

View File

@ -34,14 +34,9 @@ filter1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e2 (0 1 0);
}
e1 (1 0 0);
e2 (0 1 0);
}
}
}

View File

@ -5,6 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
( cd addLayersToFaceZone && ./Allrun )
( cd gap_detection && ./Allrun )
( cd aerofoilNACA0012_directionalRefinement && ./Allrun )
( cd iglooWithFridgesDirectionalRefinement && ./Allrun )
exit 0

View File

@ -1,9 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
#------------------------------------------------------------------------------

View File

@ -1,15 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication decomposePar
runParallel snappyHexMesh -overwrite
runApplication reconstructParMesh -constant
#------------------------------------------------------------------------------

View File

@ -1,9 +0,0 @@
Testcase for directional and automatic gap refinement. The geometry
is two nested boxes
with a single small pipe between them.
- 1 cell initial mesh
- consistent normal orientation of surface so
specify a 'gapMode' to limit refinement only to
gaps on the 'outside' of the surface
- directional refinement

View File

@ -1,124 +0,0 @@
# Wavefront OBJ file
# Regions:
# 0 patch0
#
# points : 40
# triangles : 76
#
v 80 20 -20
v -80 20 -20
v 100 0 0
v -100 0 0
v 80 20 -280
v -80 20 -280
v 80 280 -100
v -80 280 -100
v 100 0 -300
v -100 0 -300
v 100 300 -120
v -100 300 -120
v 80 280 -280
v -80 280 -280
v 100 300 -300
v -100 300 -300
v 0 445 0
v 0 445 -20
v 3.53538 446.464 0
v -3.53538 446.464 0
v -3.53538 446.464 -20
v 3.53538 446.464 -20
v 5 450 0
v -5 450 0
v -5 450 -20
v 5 450 -20
v -3.53538 453.536 0
v 3.53538 453.536 0
v -3.53538 453.536 -20
v 3.53538 453.536 -20
v 0 455 0
v 0 455 -20
v 80 580 -20
v -80 580 -20
v 80 580 -100
v -80 580 -100
v 100 600 0
v -100 600 0
v 100 600 -120
v -100 600 -120
g patch0
f 39 37 3
f 4 3 37
f 11 39 3
f 15 11 3
f 9 15 3
f 10 9 3
f 10 3 4
f 40 37 39
f 19 4 37
f 38 37 40
f 27 37 38
f 23 19 37
f 28 23 37
f 31 28 37
f 27 31 37
f 40 39 11
f 16 11 15
f 12 11 16
f 40 11 12
f 16 15 9
f 16 9 10
f 12 10 4
f 38 12 4
f 24 38 4
f 20 24 4
f 17 20 4
f 19 17 4
f 12 16 10
f 38 40 12
f 27 38 24
f 25 24 20
f 29 27 24
f 29 24 25
f 21 20 17
f 21 25 20
f 18 17 19
f 21 17 18
f 22 19 23
f 18 19 22
f 26 23 28
f 22 23 26
f 30 28 31
f 26 28 30
f 32 31 27
f 30 31 32
f 32 27 29
f 7 5 1
f 2 1 5
f 33 7 1
f 26 33 1
f 34 1 2
f 21 1 34
f 22 26 1
f 18 22 1
f 21 18 1
f 7 13 5
f 6 5 13
f 6 2 5
f 14 13 7
f 6 13 14
f 33 35 7
f 8 7 35
f 14 7 8
f 34 35 33
f 36 35 34
f 8 35 36
f 30 34 33
f 26 30 33
f 36 34 2
f 8 36 2
f 14 8 2
f 6 14 2
f 29 25 34
f 21 34 25
f 32 29 34
f 30 32 34

View File

@ -1,102 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
(-400 -100 -400)
( 400 -100 -400)
( 400 700 -400)
(-400 700 -400)
(-400 -100 400)
( 400 -100 400)
( 400 700 400)
(-400 700 400)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1 1 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
maxY
{
type patch;
faces
(
(3 7 6 2)
);
}
minX
{
type patch;
faces
(
(0 4 7 3)
);
}
maxX
{
type patch;
faces
(
(2 6 5 1)
);
}
minY
{
type patch;
faces
(
(1 5 4 0)
);
}
ground
{
type patch;
faces
(
(0 3 2 1)
);
}
maxZ
{
type patch;
faces
(
(4 5 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus s |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application snappyHexMesh;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 2000;
deltaT 1;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //

View File

@ -1,23 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
method scotch;
// ************************************************************************* //

View File

@ -1,57 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div(phi,T) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,R) bounded Gauss upwind;
div(R) Gauss linear;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear limited corrected 0.333;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default limited corrected 0.333;
}
// ************************************************************************* //

View File

@ -1,69 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-08;
relTol 0.01;
}
"(U|T|k|epsilon)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-07;
relTol 0.1;
}
}
SIMPLE
{
nNonOrthogonalCorrectors 2;
pRefCell 0;
pRefValue 0;
residualControl
{
p_rgh 1e-2;
U 1e-4;
T 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
}
relaxationFactors
{
fields
{
p_rgh 0.7;
}
equations
{
U 0.2;
T 0.5;
"(k|epsilon)" 0.7;
}
}
// ************************************************************************* //

View File

@ -1,21 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object meshQualityDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include defaults parameters from master dictionary
#includeEtc "caseDicts/meshQualityDict"
// ************************************************************************* //

View File

@ -1,326 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Which of the steps to run
castellatedMesh true;
snap false;
addLayers false;
// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
mech_test.obj
{
type triSurfaceMesh;
}
all
{
type searchableBox;
min (-1000 -1000 -1000);
max (1000 1000 1000);
}
dirRefinement
{
type searchableBox;
min (-75 25 -275);
max ( 75 275 -25);
}
};
// Settings for the castellatedMesh generation.
castellatedMeshControls
{
// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~
// If local number of cells is >= maxLocalCells on any processor
// switches from from refinement followed by balancing
// (current method) to (weighted) balancing before refinement.
maxLocalCells 100000;
// Overall cell limit (approximately). Refinement will stop immediately
// upon reaching this number so a refinement level might not complete.
// Note that this is the number of cells before removing the part which
// is not 'visible' from the keepPoint. The final number of cells might
// actually be a lot less.
maxGlobalCells 2000000;
// The surface refinement loop might spend lots of iterations refining just a
// few cells. This setting will cause refinement to stop if <= minimumRefine
// are selected for refinement. Note: it will at least do one iteration
// (unless the number of cells to refine is 0)
minRefinementCells 0;
// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
nCellsBetweenLevels 1;
// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies a level for any cell intersected by its edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
);
// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies two levels for every surface. The first is the minimum level,
// every cell intersecting a surface gets refined up to the minimum level.
// The second level is the maximum level. Cells that 'see' multiple
// intersections where the intersections make an
// angle > resolveFeatureAngle get refined up to the maximum level.
refinementSurfaces
{
mech_test.obj
{
// Surface-wise min and max refinement level
level (0 0);
}
}
// Resolve sharp angles
resolveFeatureAngle 60;
// Region-wise refinement
// ~~~~~~~~~~~~~~~~~~~~~~
// Specifies refinement level for cells in relation to a surface. One of
// three modes
// - distance. 'levels' specifies per distance to the surface the
// wanted refinement level. The distances need to be specified in
// descending order.
// - inside. 'levels' is only one entry and only the level is used. All
// cells inside the surface get refined up to the level. The surface
// needs to be closed for this to be possible.
// - outside. Same but cells outside.
refinementRegions
{
all
{
mode inside;
// Dummy base level
levels ((10000 0));
// Optional: automatic gap refinement
// If cells
// - have level 0..9
// - and are in a gap < 3 cell sizes across
// - with the gap on the inside ('inside'), outside ('outside')
// or both ('mixed') of the surface
// refine them. Ignores 'levels' and 'mode' settings
gapLevel (4 0 10);
gapMode outside;
}
dirRefinement
{
mode inside;
// Disable uniform refinement
levels ((10000 0));
// Optional: directional refinement
// (after all other refinement). Directional refinement
// for all cells according to 'mode' ('inside' or 'outside';
// 'distance' not supported) and within certain range. E.g.
// - for all cells with level 2-5
// - do one split in x direction and three splits in z direction.
// Ignores 'levels' and gap* settings. The resulting mesh is
// no longer compatible with e.g. dynamic refinement/unrefinement.
levelIncrement (2 5 (1 0 3));
}
}
// Mesh selection
// ~~~~~~~~~~~~~~
// After refinement patches get added for all refinementSurfaces and
// all cells intersecting the surfaces get put into these patches. The
// section reachable from the locationInMesh is kept.
// NOTE: This point should never be on a face, always inside a cell, even
// after refinement.
locationInMesh (-100 -5 -300);
// Whether any faceZones (as specified in the refinementSurfaces)
// are only on the boundary of corresponding cellZones or also allow
// free-standing zone faces. Not used if there are no faceZones.
allowFreeStandingZoneFaces false;
}
// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 3;
//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 2.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 30;
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
// Feature snapping
//- Number of feature edge snapping iterations.
// Leave out altogether to disable.
nFeatureSnapIter 10;
//- Detect (geometric) features by sampling the surface (default=false)
implicitFeatureSnap true;
//- Use castellatedMeshControls::features (default = true)
explicitFeatureSnap false;
}
// Settings for the layer addition.
addLayersControls
{
// Are the thickness parameters below relative to the undistorted
// size of the refined cell outside layer (true) or absolute sizes (false).
relativeSizes true;
// Per final patch (so not geometry!) the layer information
layers
{
}
// Expansion factor for layer mesh
expansionRatio 1.0;
// Wanted thickness of final added cell layer. If multiple layers
// is the thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
// is the thickness of the layer furthest away from the wall.
// See relativeSizes parameter.
finalLayerThickness 0.5;
// Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
// Relative to undistorted size of cell outside layer.
// See relativeSizes parameter.
minThickness 0.25;
// If points get not extruded do nGrow layers of connected faces that are
// also not grown. This helps convergence of the layer addition process
// close to features.
// Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
nGrow 0;
// Advanced settings
// When not to extrude surface. 0 is flat surface, 90 is when two faces
// are perpendicular
featureAngle 60;
// Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;
// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 3;
// Smooth layer thickness over surface patches
nSmoothThickness 10;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;
// Angle used to pick up medial axis points
// Note: changed(corrected) w.r.t 16x! 90 degrees corresponds to 130 in 16x.
minMedianAxisAngle 90;
// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;
// Overall max number of layer addition iterations. The mesher will exit
// if it reaches this number of iterations; possibly with an illegal
// mesh.
nLayerIter 50;
}
// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
#include "meshQualityDict"
// Advanced
//- Number of error distribution iterations
nSmoothScale 4;
//- amount to scale back displacement at error points
errorReduction 0.75;
}
// Advanced
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1e-6;
//debugFlags (mesh);
//writeFlags (scalarLevels);
// ************************************************************************* //

View File

@ -31,14 +31,9 @@ porosity1
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
}
}

View File

@ -2,7 +2,7 @@ Divergence scheme test
======================
Various divergence schemes are examined on a 2-D structured mesh, where a
passive scalar is convected at 45deg to the mesh co-ordinate system using a
passive scalar is convected at 45deg to the mesh coordinate system using a
uniform flow velocity. Executing:
./Allrun