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

This commit is contained in:
mattijs
2017-06-28 12:46:24 +01:00
33 changed files with 1358 additions and 16 deletions

View File

@ -0,0 +1,52 @@
/*--------------------------------*- 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 T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 224;
boundaryField
{
top
{
type slip;
}
bottom
{
type slip;
}
left
{
type fixedValue;
value $internalField;
}
right
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*--------------------------------*- 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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (50 0 0);
boundaryField
{
top
{
type slip;
}
bottom
{
type slip;
}
left
{
type fixedValue;
value uniform (50 0 0);
}
right
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (50 0 0);
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,65 @@
/*--------------------------------*- 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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 101325;
boundaryField
{
top
{
type zeroGradient;
}
bottom
{
type zeroGradient;
}
left
{
type waveTransmissive;
field p;
phi phi;
rho rho;
psi thermo:psi;
gamma 1.4;
fieldInf 101325;
lInf 5.0;
value $internalField;
}
right
{
type waveTransmissive;
field p;
phi phi;
rho rho;
psi thermo:psi;
gamma 1.4;
fieldInf 101325;
lInf 5.0;
value $internalField;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
restore0Dir
runApplication blockMesh
runApplication -s preProcess $(getApplication) -postProcess -dict system/preProcess
runApplication decomposePar
runParallel $(getApplication)

View File

@ -0,0 +1,53 @@
/*--------------------------------*- 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 "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type hePsiThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
equationOfState
{
p0 103308.85730683322;
T0 225.24440406165331;
}
specie
{
molWeight 28.970278977370906;
}
thermodynamics
{
Cp 1004.5;
Hf 0;
}
transport
{
mu 1.4585464649816414e-05;
Pr 0.7179;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- 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 "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,123 @@
/*--------------------------------*- 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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// D = 0.57
convertToMeters 0.57;
x0 -3.5;
x1 1.8;
x2 15.7;
x3 21;
y0 -5.2;
y1 5.2;
vertices
(
($x0 $y0 0)
($x1 $y0 0)
($x2 $y0 0)
($x3 $y0 0)
($x3 $y1 0)
($x2 $y1 0)
($x1 $y1 0)
($x0 $y1 0)
($x0 $y0 0.1)
($x1 $y0 0.1)
($x2 $y0 0.1)
($x3 $y0 0.1)
($x3 $y1 0.1)
($x2 $y1 0.1)
($x1 $y1 0.1)
($x0 $y1 0.1)
);
xSpacing ((0.5 0.5 5)(0.5 0.5 0.2));
ySpacing ((1 0.5 0.25)(1 1 1)(1 0.5 4));
blocks
(
hex (0 1 6 7 8 9 14 15) (150 200 1) simpleGrading (1 $ySpacing 1)
hex (1 2 5 6 9 10 13 14) (150 200 1) simpleGrading ($xSpacing $ySpacing 1)
hex (2 3 4 5 10 11 12 13) (150 200 1) simpleGrading (1 $ySpacing 1)
);
edges
(
);
boundary
(
top
{
type wall;
faces
(
(7 15 14 6)
(6 14 13 5)
(5 13 12 4)
);
}
bottom
{
type wall;
faces
(
(1 9 8 0)
(2 10 9 1)
(3 11 10 2)
);
}
left
{
type patch;
faces
(
(0 8 15 7)
);
}
right
{
type patch;
faces
(
(4 12 11 3)
);
}
frontAndBack
{
type empty;
faces
(
(0 7 6 1)
(1 6 5 2)
(2 5 4 3)
(8 9 14 15)
(9 10 13 14)
(10 11 12 13)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,69 @@
/*--------------------------------*- 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 controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoPimpleAdiabaticFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.22528;
deltaT 3.2e-05;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat binary;
writePrecision 10;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
functions
{
probes
{
type probes;
functionObjectLibs ("libsampling.so");
probeLocations
(
(3.0 2.0 0.0)
(3.0 -2.0 0.0)
);
fields
(
p
);
}
}
// ************************************************************************* //

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;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 3;
method hierarchical;
hierarchicalCoeffs
{
n (3 1 1);
delta 0.001;
order xyz;
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- 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
{
// Note: setting coefficient to 1 for the rhoPimpleAdiabaticFoam solver
default backward 1;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss LUST grad(U);
div(phi,h) Gauss LUST grad(h);
div(phi,K) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- 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|rho)"
{
solver PCG;
preconditioner DIC;
tolerance 1e-9;
relTol 0.01;
minIter 1;
}
"(p|rho)Final"
{
$p;
relTol 0;
}
"(U|e|h)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-9;
relTol 0.01;
}
"(U|e|h)Final"
{
$U;
relTol 0;
}
}
PIMPLE
{
momentumPredictor yes;
nOuterCorrectors 1;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,91 @@
/*--------------------------------*- 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 preProcess;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
functions
{
createVortex
{
type coded;
functionObjectLibs ("libutilityFunctionObjects.so");
redirectType createVortices;
enabled yes;
codeInclude
#{
#include "volFields.H"
#};
codeWrite
#{
scalar D = 0.57;
scalar UInf = 50;
scalar pInf = 101325;
scalar TInf = 224;
scalar gamma = 1.4;
scalar A = 0.3*D*UInf;
const dimensionedScalar rhoRef("rhoRef", dimDensity, 1);
const volScalarField& rho =
mesh().lookupObject<volScalarField>("rho");
const vectorField& C = mesh().C();
const scalarField x(C.component(0));
const scalarField y(C.component(1));
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");
if (Uptr && pPtr && TPtr)
{
volVectorField& U = *Uptr;
volScalarField& p = *pPtr;
volScalarField& T = *TPtr;
vectorField& Uc = U.primitiveFieldRef();
Uc.replace(0, UInf - rhoRef/rho()*Psi/r2*y);
Uc.replace(1, rhoRef/rho()*Psi/r2*x);
U.correctBoundaryConditions();
U.write();
scalarField& pc = p.primitiveFieldRef();
pc = pInf - 0.5*sqr(rhoRef)/rho()*sqr(Psi)/r2;
p.correctBoundaryConditions();
p.write();
scalarField& Tc = T.primitiveFieldRef();
Tc = pow(pc/pInf, (gamma - 1)/gamma)*TInf;
T.correctBoundaryConditions();
T.write();
}
else
{
FatalErrorInFunction
<< "Unable to find pressure, velocity and temperature"
<< " fields" << exit(FatalError);
}
#};
}
}
// ************************************************************************* //

View File

@ -27,13 +27,18 @@ linkParallelCase()
echo "Linking $dst parallel case from $src"
mkdir $dst
for i in constant system
# Copy system - may wish to change things
for i in system 0
do
cp -r $src/$i $dst
echo " copy $i/"
( cd $dst && cp -r ../$src/$i . )
done
echo " link processor directories with $# times: $@"
echo " link constant/"
( cd $dst && ln -sf ../$src/constant . )
echo " link processor*/ with $# times: $@"
for proc in $(cd $src && \ls -d processor*)
do
( cd $dst && ln -sf ../$src/$proc . )

View File

@ -3,7 +3,8 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# The 0/ field only
runApplication reconstructPar -withZero -time 0
# runApplication reconstructPar -withZero -time 0
runApplication reconstructParMesh -constant -withZero -time 0
# Check the location of the pressure zones
# runParallel lumpedPointZones <<- Parallel file writing not yet done

View File

@ -2,6 +2,9 @@
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Cleanup old junk that may prevent things from starting
\rm -f comms/OpenFOAM.lock
# If OpenFOAM stops prematurely, trigger the external solver to stop
trap '[ -e comms/OpenFOAM.lock ] && echo "status=done" > comms/OpenFOAM.lock' EXIT TERM INT

View File

@ -15,7 +15,7 @@ unset parallel
parallel=true
# Dummy 0 directory
mkdir 0
mkdir -p 0
if [ "${parallel:-false}" = false ]
then
@ -39,6 +39,11 @@ else
runParallel renumberMesh -overwrite
# In case serial calculations are needed later
restore0Dir # Overwrite dummy 0 directory
# runApplication reconstructParMesh -constant
fi