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

This commit is contained in:
Andrew Heather
2017-06-26 13:33:19 +01:00
72 changed files with 7072 additions and 53 deletions

View File

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
(cd steady && ./Allclean)
rm -rf movement
rm -rf transient
#------------------------------------------------------------------------------

View File

@ -0,0 +1,92 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# 1) First run steady-state to establish a good initial field.
# 2) Copy the latest state-state results for the transient case,
# but need to copy the pointDisplacement from the 0/ directory
# since it will not have been used for the steady-state case
# 3) Relocate this initial solution to coincide with the first deltaT
# to avoid overwriting the 0/ directory at all.
#
# copyParallelPointDisplacement caseDir timeName
#
# Copy pointDisplacement from caseDir/0/ to caseDir/timeName/
#
copyParallelPointDisplacement()
{
local src=$1
local dstTime=$2
local file=pointDisplacement
[ -d "$src" ] || {
echo "Error: no directory: $src"
return 1
}
# Copy select directories
echo " copy processor '$file' from 0/ -> $dstTime"
if [ -n "$dstTime" ]
then
(
cd $src || exit 1
for proc in processor*
do
[ -d "$proc/0" -a -d "$proc/$dstTime" ] && \
cp $proc/0/$file $proc/$dstTime/$file
done
)
else
echo " no destination time"
fi
# Restart from latestTime
foamDictionary $src/system/controlDict \
-entry startFrom -set latestTime
deltaT=$(foamDictionary $src/system/controlDict -entry deltaT -value)
latestTime=$(foamListTimes -case $src -noZero -latestTime -processor)
# Restart using steady results as first deltaT interval
echo "deltaT=$deltaT latestTime=$latestTime"
if [ -n "$latestTime" -a "$deltaT" != "$latestTime" ]
then
(
cd $src || exit 1
for proc in processor*
do
if [ -d "$proc/$latestTime" -a ! -d "$proc/$deltaT" ]
then
mv $proc/$latestTime $proc/$deltaT
\rm -rf $proc/$deltaT/uniform
fi
done
)
fi
return 0
}
# Do steady-state case
(cd steady && foamRunTutorials)
if ! isTest $@
then
latestTime=$(cd steady && foamListTimes -noZero -latestTime -processor)
# Clone the steady-state case to transient
cloneParallelCase steady transient 0 $latestTime
copyParallelPointDisplacement transient $latestTime
# Do the transient case
\cp files/Allrun.transient transient/Allrun
(cd transient && foamRunTutorials)
fi
#------------------------------------------------------------------------------

View File

@ -0,0 +1,59 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# 1) Run meshing
# 2) Reconstruct
# 3) Test input zones and movement
#
# linkParallelCase srcDir dstDir
#
linkParallelCase()
{
local src=$1
local dst=$2
shift 2
if [ -e "$dst" ]
then
echo "Case already linked: remove case directory $dst prior to linking"
return 1
elif [ ! -d "$src" ]
then
echo "Error: no directory to link: $src"
return 1
fi
echo "Linking $dst parallel case from $src"
mkdir $dst
for i in constant system
do
cp -r $src/$i $dst
done
echo " link processor directories with $# times: $@"
for proc in $(cd $src && \ls -d processor*)
do
( cd $dst && ln -sf ../$src/$proc . )
done
return 0
}
# Do steady-state case
(cd steady && ./Allrun.pre)
if ! isTest $@
then
# Copy/link the steady-state case to movement
linkParallelCase steady movement
# Test movement
\cp files/Allrun.movement movement/Allrun
(cd movement && foamRunTutorials)
fi
#------------------------------------------------------------------------------

View File

@ -0,0 +1,16 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# The 0/ field only
runApplication reconstructPar -withZero -time 0
# Check the location of the pressure zones
# runParallel lumpedPointZones <<- Parallel file writing not yet done
runApplication lumpedPointZones
# Simulated external solver
# Using -scale=1 to see the excessively large movements
runApplication lumpedPointMovement -span 25 -scale 1 ../files/response.txt
#------------------------------------------------------------------------------

View File

@ -0,0 +1,16 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# If OpenFOAM stops prematurely, trigger the external solver to stop
trap '[ -e comms/OpenFOAM.lock ] && echo "status=done" > comms/OpenFOAM.lock' EXIT TERM INT
# Simulated external solver.
# Using -scale since the input movement table is excessively large
runApplication -overwrite \
lumpedPointMovement -scale 0.01 -removeLock -slave ../files/response.txt &
# Run OpenFOAM
runParallel $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,50 @@
/*--------------------------------*- 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 volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 1 -1 0 0 0 0];
internalField uniform $flowVelocity;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
#include "include/fixedInlet"
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value $internalField;
}
// the ground
z_
{
type noSlip;
}
"(?i).*building.*"
{
type noSlip;
}
#include "include/environ"
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- 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 volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 2 -3 0 0 0 0];
internalField uniform $turbulentEpsilon;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
#include "include/fixedInlet"
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
z_
{
type epsilonWallFunction;
value $internalField;
}
"(?i).*building.*"
{
type epsilonWallFunction;
value $internalField;
}
#include "include/environ"
}
// ************************************************************************* //

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
_y
{
type slip;
}
y_
{
type slip;
}
_z
{
type slip;
}
// ************************************************************************* //

View File

@ -0,0 +1,15 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
inlet
{
type fixedValue;
value $internalField;
}
// ************************************************************************* //

View File

@ -0,0 +1,17 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
flowVelocity (100 0 0);
pressure 0;
turbulentKE 37;
turbulentOmega 32;
turbulentEpsilon 30;
#inputMode merge
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- 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 volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 2 -2 0 0 0 0];
internalField uniform $turbulentKE;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
#include "include/fixedInlet"
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
z_
{
type kqRWallFunction;
value $internalField;
}
"(?i).*building.*"
{
type kqRWallFunction;
value $internalField;
}
#include "include/environ"
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- 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 volScalarField;
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
z_
{
type nutkWallFunction;
value uniform 0;
}
"(?i).*building.*"
{
type nutkWallFunction;
value uniform 0;
}
".*"
{
type calculated;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- 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 volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 0 -1 0 0 0 0];
internalField uniform $turbulentOmega;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
#include "include/fixedInlet"
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
z_
{
type omegaWallFunction;
value $internalField;
}
"(?i).*building.*"
{
type omegaWallFunction;
value $internalField;
}
#include "include/environ"
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- 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 volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 2 -2 0 0 0 0];
internalField uniform $pressure;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value $internalField;
}
z_
{
type zeroGradient;
}
"(?i).*building.*"
{
type zeroGradient;
}
#include "include/environ"
}
// ************************************************************************* //

View File

@ -0,0 +1,73 @@
/*--------------------------------*- 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 pointVectorField;
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
// Specify directly (without include) for benefit of the paraview reader
processor
{
type processor;
value uniform (0 0 0);
}
inlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}
outlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}
_y
{
type uniformFixedValue;
uniformValue (0 0 0);
}
y_
{
type uniformFixedValue;
uniformValue (0 0 0);
}
_z
{
type uniformFixedValue;
uniformValue (0 0 0);
}
// the ground
z_
{
type slip;
}
"(?i).*building.*"
{
type lumpedPointDisplacement;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
\rm -rf 0
#------------------------------------------------------------------------------

View File

@ -0,0 +1,24 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
./Allrun.pre
unset parallel
parallel=true
if [ "${parallel:-false}" = false ]
then
# Serial
runApplication simpleFoam
else
# Parallel
runParallel simpleFoam
fi
#------------------------------------------------------------------------------

View File

@ -0,0 +1,45 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Copy building from resources directory
mkdir -p constant/triSurface/
cp $FOAM_TUTORIALS/resources/geometry/building_wtc2.obj constant/triSurface/
# runApplication surfaceFeatureExtract
runApplication blockMesh
\rm -f constant/polyMesh/*Level
unset parallel
parallel=true
# Dummy 0 directory
mkdir 0
if [ "${parallel:-false}" = false ]
then
# Serial
runApplication snappyHexMesh -overwrite
\rm -f constant/polyMesh/refinementHistory*
restore0Dir
runApplication renumberMesh -overwrite
else
# Parallel
runApplication decomposePar -force
runParallel snappyHexMesh -overwrite
\ls -d processor* | xargs -I {} \rm -f ./{}/constant/polyMesh/refinementHistory
restore0Dir -processor
runParallel renumberMesh -overwrite
fi
#------------------------------------------------------------------------------

View File

@ -0,0 +1,31 @@
/*--------------------------------*- 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 dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libfvMotionSolvers.so");
solver displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity inverseDistance ( targetBuilding );
}
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- 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 transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1.5e-05;
// ************************************************************************* //

View File

@ -0,0 +1,29 @@
/*--------------------------------*- 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 turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
// RASModel kOmegaSST;
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*--------------------------------*- 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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
( -1.6065 -1.428 0.0)
( 1.6065 -1.428 0.0)
( 1.6065 1.428 0.0)
( -1.6065 1.428 0.0)
( -1.6065 -1.428 2.021031)
( 1.6065 -1.428 2.021031)
( 1.6065 1.428 2.021031)
( -1.6065 1.428 2.021031)
);
blocks
(
// High resolution
// hex (0 1 2 3 4 5 6 7) (153 136 168) simpleGrading (1 1 5)
// Low resolution
hex (0 1 2 3 4 5 6 7) (77 68 84) simpleGrading (1 1 5)
);
edges
(
);
boundary
(
inlet // -ve X
{
type patch;
faces
(
( 0 4 7 3 )
);
}
outlet // +x X
{
type patch;
faces
(
( 1 2 6 5 )
);
}
y_ // -ve Y
{
type wall;
faces
(
( 0 1 5 4)
);
}
_y // +ve Y
{
type wall;
faces
(
( 3 7 6 2)
);
}
z_ // -ve Z = ground
{
type wall;
faces
(
( 0 3 2 1)
);
}
_z // +ve Z = sky
{
type wall;
faces
(
( 4 5 6 7)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,75 @@
/*--------------------------------*- 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 controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs ("liblumpedPointMotion.so");
application pimpleDyMFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.01;
deltaT 1e-4;
writeControl timeStep;
writeInterval 10;
purgeWrite 0;
writeFormat binary;
writePrecision 8;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
adjustTimeStep yes;
// These can be a bit larger when we restart from steady-state
maxCo 0.75;
maxDeltaT 0.01;
// Embed steady-state settings (simpleFoam) without changeDictionary
_simpleFoam
{
endTime 500;
writeInterval 100;
deltaT 1;
adjustTimeStep no;
}
${_${FOAM_EXECUTABLE}};
#remove _simpleFoam
functions
{
}
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- 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;
note "mesh decomposition control dictionary";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 12;
method scotch;
// method hierarchical;
hierarchicalCoeffs
{
n (3 2 1);
delta 0.001;
order xyz;
}
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*--------------------------------*- 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 fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(U) cellLimited Gauss linear 1;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwindV grad(U);
div(phi,k) bounded Gauss upwind;
div(phi,omega) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
wallDist
{
method meshWave;
}
// Embed steady-state settings (simpleFoam) without changeDictionary
_simpleFoam
{
ddtSchemes
{
default steadyState;
}
}
${_${FOAM_EXECUTABLE}};
#remove _simpleFoam
// ************************************************************************* //

View File

@ -0,0 +1,134 @@
/*--------------------------------*- 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 fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver GAMG;
tolerance 1e-7;
relTol 0.01;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration true;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;
}
"(cellDisplacement)"
{
$p;
tolerance 1e-6;
relTol 0.001;
minIter 1;
}
pFinal
{
$p;
tolerance 1e-6;
relTol 0;
}
cellDisplacementFinal
{
$cellDisplacement;
tolerance 1e-6;
relTol 0;
}
Phi
{
$p;
}
"(U|k|epsilon|omega)"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
}
"(U|k|epsilon|omega)Final"
{
$U;
relTol 0;
}
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
consistent yes;
pRefCell 0;
pRefValue 0;
}
PIMPLE
{
nOuterCorrectors 2;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
potentialFlow
{
nNonOrthogonalCorrectors 10;
}
cache
{
grad(U);
}
// Default relaxation for transient
relaxationFactors
{
equations
{
".*" 1;
}
}
// Embed steady-state settings (simpleFoam) without changeDictionary
_simpleFoam
{
fields
{
p 1.0;
}
equations
{
"(U|k|epsilon)" 0.9;
}
}
relaxationFactors
{
${_${FOAM_EXECUTABLE}};
}
#remove _simpleFoam
// ************************************************************************* //

View File

@ -0,0 +1,75 @@
/*--------------------------------*- 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 lumpedPointMovement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Reference axis for the locations
axis (0 0 1);
// Locations of the lumped points
locations 11(0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5);
// Division for pressure forces (0-1)
division 0.5;
//- If present, the offset of patch points compared to the locations
// Otherwise determined from the bounding box
// centre (0 0 0);
//- The interpolation scheme
interpolationScheme linear;
//- Relaxation/scaling factor when updating positions
relax 1.0;
forces
{
//- The pressure name (default: p)
p p;
//- Reference pressure [Pa] (default: 0)
pRef 0;
//- Reference density for incompressible calculations (default: 1)
rhoRef 1;
}
communication
{
commsDir "comms";
log on;
waitInterval 1;
timeOut 100;
initByExternal false;
// Input file of positions/rotation, written by external application
inputName positions.in;
// Output file of forces, written by OpenFOAM
outputName forces.out;
inputFormat dictionary;
outputFormat dictionary;
debugTable "$FOAM_CASE/output.txt";
}
// ************************************************************************* //

View File

@ -0,0 +1,24 @@
/*--------------------------------*- 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"
//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.02;
// ************************************************************************* //

View File

@ -0,0 +1,305 @@
/*--------------------------------*- 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 true;
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
{
building_wtc2.obj
{
type triSurfaceMesh;
name building;
}
};
// 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 10;
// Allow a certain level of imbalance during refining
// (since balancing is quite expensive)
// Expressed as fraction of perfect balance (= overall number of cells /
// nProcs). 0=balance always.
maxLoadUnbalance 0.10;
// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
nCellsBetweenLevels 15;
// 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
{
building
{
// Surface-wise min and max refinement level
level (2 2);
// Optional specification of patch type (default is wall). No
// constraint types (cyclic, symmetry) etc. are allowed.
patchInfo
{
type wall;
inGroups (targetBuilding);
}
}
}
// Resolve sharp angles
resolveFeatureAngle 30;
// 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
{
}
// 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 (0 0 1.99);
// 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 true;
}
// 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 only) features by sampling the surface
// (default=false).
implicitFeatureSnap false;
//- Use castellatedMeshControls::features (default = true)
explicitFeatureSnap true;
//- Detect points on multiple surfaces (only for explicitFeatureSnap)
multiRegionFeatureSnap 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.
// See relativeSizes parameter.
finalLayerThickness 0.3;
// 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.
minThickness 0.1;
// 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;
// At non-patched sides allow mesh to slip if extrusion direction makes
// angle larger than slipFeatureAngle.
slipFeatureAngle 30;
// Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 3;
// 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 17x! 90 degrees corresponds to 130 in 17x.
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
// Write flags
writeFlags
(
scalarLevels
layerSets
layerFields // write volScalarField for layer coverage
);
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1e-6;
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
/*--------------------------------*- 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 surfaceFeatureExtractDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
building_wtc2.obj
{
// How to obtain raw features (extractFromFile || extractFromSurface)
extractionMethod extractFromSurface;
// Mark edges whose adjacent surface normals are at an angle less
// than includedAngle as features
// - 0 : selects no edges
// - 180: selects all edges
includedAngle 85;
// Write features to obj format for postprocessing
writeObj false;
}
// ************************************************************************* //