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;
}
// ************************************************************************* //

View File

@ -32,7 +32,7 @@ boundaryField
wall
{
type nutkRoughWallFunction;
type nutkWallFunction;
Ks uniform 100e-6;
Cs uniform 0.5;
value $internalField;

View File

@ -33,6 +33,7 @@ boundaryField
wall
{
type omegaWallFunction;
blended true;
value $internalField;
}
}

View File

@ -28,7 +28,7 @@ startTime 0;
stopAt endTime;
endTime 2;
endTime 0.6;
deltaT 0.001;

View File

@ -37,7 +37,7 @@ divSchemes
laplacianSchemes
{
default Gauss linear corrected;
default Gauss linear limited corrected 0.333;
}
interpolationSchemes
@ -47,7 +47,7 @@ interpolationSchemes
snGradSchemes
{
default corrected;
default limited corrected 0.333;
}
wallDist

View File

@ -73,10 +73,8 @@ PIMPLE
{
momentumPredictor yes;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
pRefPoint (0.51 0.51 0.51);
pRefValue 0;
nOuterCorrectors 1;
nNonOrthogonalCorrectors 1;
}

View File

@ -0,0 +1,319 @@
# Wavefront OBJ file
# source https://grabcad.com/library/1-world-trade-center-1
#
# Terms of Usage:
# One World Trade Center by CaitlinLe is licensed under the
# Creative Commons - Attribution - Share Alike license.
#
o targetBuilding_wtc2
# points : 101
# faces : 198
# zones : 1
# 0 building (nFaces: 198)
# <points count="101">
v 0.21015 0.243555 7.5e-06
v 0.21015 0.056445 7.5e-06
v 0.38985 0.056445 7.5e-06
v 0.38985 0.243555 7.5e-06
v 0.2109 0.0616875 0.111383
v 0.21522 0.0571875 0.111383
v 0.2109 0.239858 0.111383
v 0.3891 0.0601425 0.111383
v 0.386258 0.0571875 0.111383
v 0.213735 0.242812 0.111383
v 0.3891 0.242812 0.111383
v 0.21015 0.056445 0.111383
v 0.21015 0.243555 0.111383
v 0.38985 0.056445 0.111383
v 0.38985 0.243555 0.111383
v 0.3891 0.242812 0.119212
v 0.2109 0.150773 0.728745
v 0.300742 0.0571875 0.72873
v 0.262478 0.11247 0.742507
v 0.255555 0.120915 0.742507
v 0.270915 0.105547 0.742507
v 0.250403 0.130545 0.742507
v 0.280545 0.100395 0.742507
v 0.290992 0.0972375 0.742507
v 0.247237 0.140992 0.742507
v 0.246173 0.151853 0.742507
v 0.30186 0.0961575 0.742507
v 0.247237 0.162712 0.742507
v 0.31272 0.0972375 0.742507
v 0.250403 0.17316 0.742507
v 0.323168 0.100395 0.742507
v 0.255555 0.18279 0.742507
v 0.332798 0.105547 0.742507
v 0.262478 0.191235 0.742507
v 0.341235 0.11247 0.742507
v 0.348157 0.120915 0.742507
v 0.270915 0.198157 0.742507
v 0.280545 0.20331 0.742507
v 0.35331 0.130545 0.742507
v 0.290992 0.206467 0.742507
v 0.356475 0.140992 0.742507
v 0.35754 0.151853 0.742507
v 0.30186 0.20754 0.742507
v 0.31272 0.206467 0.742507
v 0.356475 0.162712 0.742507
v 0.35331 0.17316 0.742507
v 0.323168 0.20331 0.742507
v 0.348157 0.18279 0.742507
v 0.332798 0.198157 0.742507
v 0.341235 0.191235 0.742507
v 0.212805 0.150773 0.742507
v 0.3891 0.151207 0.742507
v 0.3891 0.152872 0.742507
v 0.300742 0.059175 0.742507
v 0.301163 0.242812 0.742507
v 0.30276 0.242812 0.742507
v 0.3 0.149993 0.764783
v 0.301853 0.150495 0.764783
v 0.298148 0.150495 0.764783
v 0.303218 0.151853 0.764783
v 0.296783 0.151853 0.764783
v 0.30372 0.153713 0.764783
v 0.29628 0.153713 0.764783
v 0.303218 0.155565 0.764783
v 0.296783 0.155565 0.764783
v 0.301853 0.156922 0.764783
v 0.298148 0.156922 0.764783
v 0.3 0.157425 0.764783
v 0.262478 0.11247 0.764783
v 0.255555 0.120915 0.764783
v 0.270915 0.105547 0.764783
v 0.250403 0.130545 0.764783
v 0.280545 0.100395 0.764783
v 0.247237 0.140992 0.764783
v 0.290992 0.0972375 0.764783
v 0.246173 0.151853 0.764783
v 0.30186 0.0961575 0.764783
v 0.247237 0.162712 0.764783
v 0.31272 0.0972375 0.764783
v 0.250403 0.17316 0.764783
v 0.323168 0.100395 0.764783
v 0.255555 0.18279 0.764783
v 0.332798 0.105547 0.764783
v 0.262478 0.191235 0.764783
v 0.341235 0.11247 0.764783
v 0.348157 0.120915 0.764783
v 0.270915 0.198157 0.764783
v 0.35331 0.130545 0.764783
v 0.280545 0.20331 0.764783
v 0.290992 0.206467 0.764783
v 0.356475 0.140992 0.764783
v 0.35754 0.151853 0.764783
v 0.30186 0.20754 0.764783
v 0.31272 0.206467 0.764783
v 0.356475 0.162712 0.764783
v 0.35331 0.17316 0.764783
v 0.323168 0.20331 0.764783
v 0.348157 0.18279 0.764783
v 0.332798 0.198157 0.764783
v 0.341235 0.191235 0.764783
v 0.3 0.153713 0.95784
# </points>
# <faces count="198">
g building
f 1 2 12
f 13 1 12
f 12 2 14
f 3 14 2
f 3 2 4
f 2 1 4
f 4 15 14
f 4 14 3
f 15 4 13
f 1 13 4
f 13 7 10
f 44 94 97
f 44 97 47
f 13 10 15
f 11 15 10
f 44 43 93
f 44 93 94
f 11 10 16
f 47 56 44
f 11 8 15
f 14 15 8
f 14 8 9
f 11 16 8
f 46 96 95
f 46 95 45
f 52 53 42
f 17 7 5
f 95 92 42
f 95 42 45
f 18 9 8
f 98 64 96
f 95 96 62
f 5 12 6
f 9 6 14
f 41 52 42
f 101 64 66
f 92 41 42
f 60 62 101
f 62 64 101
f 12 14 6
f 12 5 13
f 7 13 5
f 65 78 63
f 63 74 61
f 72 70 61
f 67 84 65
f 55 43 56
f 46 45 53
f 45 42 53
f 16 56 53
f 26 76 78
f 26 78 28
f 78 80 30
f 78 30 28
f 16 53 8
f 52 8 53
f 101 66 68
f 28 51 26
f 28 30 51
f 101 58 60
f 48 53 50
f 56 50 53
f 50 100 98
f 50 98 48
f 46 53 48
f 46 48 96
f 98 96 48
f 83 58 81
f 81 58 79
f 85 58 83
f 99 66 100
f 100 64 98
f 50 56 49
f 97 94 66
f 64 100 66
f 62 96 64
f 91 92 62
f 97 66 99
f 99 49 97
f 62 60 91
f 58 85 60
f 88 60 86
f 88 91 60
f 50 49 99
f 50 99 100
f 90 68 93
f 101 68 67
f 56 47 49
f 49 47 97
f 38 40 55
f 77 79 57
f 86 60 85
f 92 95 62
f 57 79 58
f 91 41 92
f 88 39 41
f 88 41 91
f 86 36 39
f 86 39 88
f 85 36 86
f 41 39 52
f 35 52 36
f 39 36 52
f 94 93 68
f 89 67 90
f 87 67 89
f 84 82 65
f 82 80 65
f 78 65 80
f 84 67 87
f 87 37 34
f 87 34 84
f 18 8 52
f 34 32 82
f 34 82 84
f 89 38 37
f 89 37 87
f 57 58 101
f 90 40 38
f 90 38 89
f 19 69 70
f 24 77 75
f 71 73 59
f 57 59 73
f 75 57 73
f 77 57 75
f 73 23 24
f 73 24 75
f 71 21 23
f 71 23 73
f 69 19 21
f 69 21 71
f 23 54 24
f 54 21 19
f 51 25 26
f 51 55 17
f 55 10 7
f 17 55 7
f 56 16 55
f 10 55 16
f 5 6 18
f 54 51 17
f 18 54 17
f 17 5 18
f 18 6 9
f 52 35 54
f 35 33 54
f 52 54 18
f 36 85 35
f 33 31 54
f 83 33 35
f 83 35 85
f 31 29 54
f 81 31 33
f 81 33 83
f 79 29 31
f 79 31 81
f 77 27 29
f 77 29 79
f 77 24 27
f 27 24 54
f 54 29 27
f 72 61 74
f 70 69 61
f 59 61 69
f 69 71 59
f 20 22 51
f 19 70 20
f 25 51 22
f 74 25 22
f 74 22 72
f 74 76 25
f 26 25 76
f 22 20 70
f 22 70 72
f 23 21 54
f 54 19 51
f 20 51 19
f 93 43 40
f 93 40 90
f 80 82 30
f 32 30 82
f 37 38 55
f 34 37 55
f 32 34 51
f 55 51 34
f 30 32 51
f 44 56 43
f 43 55 40
f 101 65 63
f 101 63 61
f 59 101 61
f 101 67 65
f 59 57 101
f 68 90 67
f 78 76 63
f 68 66 94
f 76 74 63
# </faces>