mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into molecularDynamics
This commit is contained in:
5
Allwmake
5
Allwmake
@ -1,10 +1,13 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
# run from this directory only
|
||||
cd ${0%/*} || exit 1
|
||||
|
||||
# wmake is required for subsequent targets
|
||||
(cd wmake/src && make)
|
||||
|
||||
(cd $WM_PROJECT_INST_DIR/ThirdParty && ./Allwmake)
|
||||
(cd $WM_THIRD_PARTY_DIR && ./Allwmake)
|
||||
|
||||
(cd src && ./Allwmake)
|
||||
|
||||
|
||||
63
README
63
README
@ -29,8 +29,8 @@
|
||||
2. System requirements
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
OpenFOAM is developed and tested on Linux, but should work with other
|
||||
Unix style system. To check your system setup, execute the foamSystemCheck
|
||||
script in the bin directory of the OpenFOAM installation. If no problems
|
||||
Unix style systems. To check your system setup, execute the foamSystemCheck
|
||||
script in the bin/ directory of the OpenFOAM installation. If no problems
|
||||
are reported, proceed to "3. Installation"; otherwise contact your
|
||||
system administrator.
|
||||
|
||||
@ -40,7 +40,6 @@
|
||||
|
||||
3. Installation
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Download and unpack the files in the $HOME/OpenFOAM directory as described
|
||||
in: http://www.OpenFOAM.org/download.html
|
||||
|
||||
@ -77,10 +76,9 @@
|
||||
|
||||
3.1. Installation in alternative locations
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
OpenFOAM may also be installed in an alternative location.
|
||||
However, the installation directory must be network available
|
||||
(eg, NFS) if parallel calculations are planned.
|
||||
OpenFOAM may also be installed in alternative locations. However, the
|
||||
installation directory should be network available (e.g., NFS) if
|
||||
parallel calculations are planned.
|
||||
|
||||
The environment variable 'FOAM_INST_DIR' can be used to find and source
|
||||
the appropriate resource file. Here is a bash/ksh/sh example:
|
||||
@ -89,7 +87,7 @@
|
||||
foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
|
||||
[ -f $foamDotFile ] && . $foamDotFile
|
||||
|
||||
and a csh example:
|
||||
and a csh/tcsh example:
|
||||
|
||||
setenv FOAM_INST_DIR /data/app/OpenFOAM
|
||||
foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
|
||||
@ -102,9 +100,8 @@
|
||||
|
||||
4. Building from Sources (Optional)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you cannot find an appropriate binary pack for your platform, you can
|
||||
build the complete OpenFOAM from the source-pack. First you will need to
|
||||
build the complete OpenFOAM from the source-pack. You will first need to
|
||||
compile or obtain a recent version of gcc (we recomend gcc-4.2.?) for
|
||||
your platform, which may be obtained from http://gcc.gnu.org/.
|
||||
|
||||
@ -114,29 +111,27 @@
|
||||
$WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the
|
||||
environment variables as in section 3.
|
||||
|
||||
Now go to the top-level source directory $WM_PROJECT_DIR and type
|
||||
./Allwmake, which is the name of the top-level build script for building
|
||||
the whole of OpenFOAM. In principle this will build everything, but
|
||||
sometimes problems occur with the build order and it is necessary to
|
||||
update the environment variables and re-execute Allwmake. If you
|
||||
experience difficulties with building the source-pack or your platform is
|
||||
not currently supported please contact <enquiries@OpenCFD.co.uk> to
|
||||
negotiate a support contract and we will do the port and maintain it in
|
||||
Now go to the top-level source directory $WM_PROJECT_DIR and execute the
|
||||
top-level build script './Allwmake'. In principle this will build
|
||||
everything, but if problems occur with the build order it may be necessary
|
||||
to update the environment variables and re-execute 'Allwmake'. If you
|
||||
experience difficulties with building the source-pack, or your platform is
|
||||
not currently supported, please contact <enquiries@OpenCFD.co.uk> to
|
||||
negotiate a support contract and we will do the port and maintain it for
|
||||
future releases.
|
||||
|
||||
|
||||
5. Testing the installation
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
To check your installation setup, execute the 'foamInstallationTest'
|
||||
script (in the bin directory of the OpenFOAM installation). If no problems
|
||||
are reported, proceed to getting started with OpenFOAM; otherwise, go back
|
||||
and check you have installed the software correctly and/or contact your
|
||||
system administrator.
|
||||
script (in the bin/ directory of the OpenFOAM installation). If no
|
||||
problems are reported, proceed to getting started with OpenFOAM;
|
||||
otherwise, go back and check you have installed the software correctly
|
||||
and/or contact your system administrator.
|
||||
|
||||
|
||||
6. Getting Started
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Create a project directory within the $HOME/OpenFOAM directory named
|
||||
<USER>-<VERSION> (e.g. 'chris-1.5' for user chris and OpenFOAM version 1.5)
|
||||
and create a directory named 'run' within it, e.g. by typing:
|
||||
@ -144,7 +139,7 @@
|
||||
mkdir -p $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
|
||||
|
||||
Copy the 'tutorial' examples directory in the OpenFOAM distribution to the
|
||||
'run' directory. If OpenFOAM environment variables are set correctly,
|
||||
'run' directory. If the OpenFOAM environment variables are set correctly,
|
||||
then the following command will be correct:
|
||||
|
||||
cp -r $WM_PROJECT_DIR/tutorials $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
|
||||
@ -158,27 +153,27 @@
|
||||
|
||||
7. Documentation
|
||||
~~~~~~~~~~~~~~~~
|
||||
http://www.OpenFOAM.org/doc
|
||||
http://www.OpenFOAM.org/doc
|
||||
|
||||
|
||||
8. Help
|
||||
~~~~~~~
|
||||
http://www.OpenFOAM.org
|
||||
http://www.OpenFOAM.org/discussion.html
|
||||
http://www.OpenFOAM.org
|
||||
http://www.OpenFOAM.org/discussion.html
|
||||
|
||||
|
||||
9. Reporting Bugs in OpenFOAM
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
http://www.OpenFOAM.org/bugs.html
|
||||
http://www.OpenFOAM.org/bugs.html
|
||||
|
||||
|
||||
A. Running OpenFOAM in 32-bit mode on 64-bit machines
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Those users with an installation of Linux on a 64-bit machine may install
|
||||
either or both of the 32-bit version of OpenFOAM (linux) or the 64-bit
|
||||
version of FOAM (linux64) with 64-bit being the default mode. In order to
|
||||
set up the user to run in 32-bit mode, the user must set the environment
|
||||
variable $WM_32 (to anything, e.g. "on") before sourcing the etc/bashrc
|
||||
(or etc/cshrc) file. Unsetting $WM_32 and sourcing the bashrc file will
|
||||
Linux users with a 64-bit machine may install either the OpenFOAM 32-bit
|
||||
version (linux) or the OpenFOAM 64-bit version (linux64), or both.
|
||||
The 64-bit is the default mode on a 64-bit machine. To use an installed
|
||||
32-bit version, the user must set the environment variable $WM_32 (to
|
||||
anything, e.g. "on") before sourcing the etc/bashrc (or etc/cshrc) file.
|
||||
Unsetting WM_32 and re-sourcing the etc/bashrc (or etc/cshrc) file will
|
||||
set up the user to run in 64-bit mode.
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
|
||||
@ -35,7 +35,7 @@ namespace Foam
|
||||
{
|
||||
namespace compressible
|
||||
{
|
||||
namespace turbulenceModels
|
||||
namespace RAS
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -55,12 +55,15 @@ PDRkEpsilon::PDRkEpsilon
|
||||
:
|
||||
turbulenceModel(typeName, rho, U, phi, thermophysicalModel),
|
||||
|
||||
Cmu(turbulenceModelCoeffs_.lookup("Cmu")),
|
||||
C1(turbulenceModelCoeffs_.lookup("C1")),
|
||||
C2(turbulenceModelCoeffs_.lookup("C2")),
|
||||
alphak(turbulenceModelCoeffs_.lookup("alphak")),
|
||||
alphaEps(turbulenceModelCoeffs_.lookup("alphaEps")),
|
||||
alphah(turbulenceModelCoeffs_.lookup("alphah")),
|
||||
Cmu(turbulenceModelCoeffs_.lookupOrAddDefault<scalar>("Cmu", 0.09)),
|
||||
C1(turbulenceModelCoeffs_.lookupOrAddDefault<scalar>("C1", 1.44)),
|
||||
C2(turbulenceModelCoeffs_.lookupOrAddDefault<scalar>("C2", 1.92)),
|
||||
alphak(turbulenceModelCoeffs_.lookupOrAddDefault<scalar>("alphak", 1.0)),
|
||||
alphaEps
|
||||
(
|
||||
turbulenceModelCoeffs_.lookupOrAddDefault<scalar>("alphaEps", 0.76923)
|
||||
),
|
||||
alphah(turbulenceModelCoeffs_.lookupOrAddDefault<scalar>("alphah", 1.0)),
|
||||
|
||||
k_
|
||||
(
|
||||
@ -102,6 +105,8 @@ PDRkEpsilon::PDRkEpsilon
|
||||
)
|
||||
{
|
||||
# include "wallViscosityI.H"
|
||||
|
||||
printCoeffs();
|
||||
}
|
||||
|
||||
|
||||
@ -161,12 +166,12 @@ bool PDRkEpsilon::read()
|
||||
{
|
||||
if (turbulenceModel::read())
|
||||
{
|
||||
turbulenceModelCoeffs_.lookup("Cmu") >> Cmu;
|
||||
turbulenceModelCoeffs_.lookup("C1") >> C1;
|
||||
turbulenceModelCoeffs_.lookup("C2") >> C2;
|
||||
turbulenceModelCoeffs_.lookup("alphak") >> alphak;
|
||||
turbulenceModelCoeffs_.lookup("alphaEps") >> alphaEps;
|
||||
turbulenceModelCoeffs_.lookup("alphah") >> alphah;
|
||||
turbulenceModelCoeffs_.readIfPresent<scalar>("Cmu", Cmu);
|
||||
turbulenceModelCoeffs_.readIfPresent<scalar>("C1", C1);
|
||||
turbulenceModelCoeffs_.readIfPresent<scalar>("C2", C2);
|
||||
turbulenceModelCoeffs_.readIfPresent<scalar>("alphak", alphak);
|
||||
turbulenceModelCoeffs_.readIfPresent<scalar>("alphaEps", alphaEps);
|
||||
turbulenceModelCoeffs_.readIfPresent<scalar>("alphah", alphah);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -204,7 +209,7 @@ void PDRkEpsilon::correct()
|
||||
// in both the k and epsilon equations
|
||||
const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
|
||||
|
||||
const PDRDragModel& drag =
|
||||
const PDRDragModel& drag =
|
||||
U_.db().lookupObject<PDRDragModel>("PDRDragModel");
|
||||
|
||||
volScalarField GR = drag.Gk();
|
||||
@ -259,7 +264,7 @@ void PDRkEpsilon::correct()
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace turbulenceModels
|
||||
} // End namespace RAS
|
||||
} // End namespace compressible
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ namespace Foam
|
||||
{
|
||||
namespace compressible
|
||||
{
|
||||
namespace turbulenceModels
|
||||
namespace RAS
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -58,12 +58,12 @@ class PDRkEpsilon
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar Cmu;
|
||||
dimensionedScalar C1;
|
||||
dimensionedScalar C2;
|
||||
dimensionedScalar alphak;
|
||||
dimensionedScalar alphaEps;
|
||||
dimensionedScalar alphah;
|
||||
scalar Cmu;
|
||||
scalar C1;
|
||||
scalar C2;
|
||||
scalar alphak;
|
||||
scalar alphaEps;
|
||||
scalar alphah;
|
||||
|
||||
volScalarField k_;
|
||||
volScalarField epsilon_;
|
||||
@ -103,7 +103,7 @@ public:
|
||||
//- Return the effective diffusivity for k
|
||||
tmp<volScalarField> DkEff() const
|
||||
{
|
||||
return tmp<volScalarField>
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
new volScalarField("DkEff", alphak*mut_ + mu())
|
||||
);
|
||||
@ -112,7 +112,7 @@ public:
|
||||
//- Return the effective diffusivity for epsilon
|
||||
tmp<volScalarField> DepsilonEff() const
|
||||
{
|
||||
return tmp<volScalarField>
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
new volScalarField("DepsilonEff", alphaEps*mut_ + mu())
|
||||
);
|
||||
@ -121,7 +121,7 @@ public:
|
||||
//- Return the effective turbulent thermal diffusivity
|
||||
tmp<volScalarField> alphaEff() const
|
||||
{
|
||||
return tmp<volScalarField>
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
new volScalarField("alphaEff", alphah*mut_ + alpha())
|
||||
);
|
||||
@ -158,7 +158,7 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace turbulenceModels
|
||||
} // End namespace RAS
|
||||
} // End namespace compressible
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -3,8 +3,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
|
||||
|
||||
@ -6,7 +6,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/lnInclude
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS/compressible/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lengine \
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I../engineFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I../dieselEngineFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||
|
||||
@ -4,7 +4,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
|
||||
-I../XiFoam
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I../XiFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
|
||||
@ -2,8 +2,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -2,7 +2,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -3,7 +3,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -2,7 +2,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -2,7 +2,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -2,7 +2,7 @@ EXE_INC = \
|
||||
-I../sonicFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
nAveragingSteps++;
|
||||
|
||||
scalar nm1Coeff = scalar(nAveragingSteps - 1)/nAveragingSteps;
|
||||
scalar nCoeff = 1.0/nAveragingSteps;
|
||||
|
||||
R += sqr(Umean);
|
||||
Umean = nm1Coeff*Umean + nCoeff*U;
|
||||
R = nm1Coeff*R + nCoeff*sqr(U) - sqr(Umean);
|
||||
Bmean = nm1Coeff*Bmean + nCoeff*sgsModel->B();
|
||||
epsilonMean = nm1Coeff*epsilonMean + nCoeff*sgsModel->epsilon();
|
||||
|
||||
pPrime2Mean += sqr(pMean);
|
||||
pMean = nm1Coeff*pMean + nCoeff*p;
|
||||
pPrime2Mean = nm1Coeff*pPrime2Mean + nCoeff*sqr(p) - sqr(pMean);
|
||||
@ -0,0 +1,14 @@
|
||||
nAveragingSteps++;
|
||||
|
||||
scalar nm1Coeff = scalar(nAveragingSteps - 1)/nAveragingSteps;
|
||||
scalar nCoeff = 1.0/nAveragingSteps;
|
||||
|
||||
R += sqr(Umean);
|
||||
Umean = nm1Coeff*Umean + nCoeff*U;
|
||||
R = nm1Coeff*R + nCoeff*sqr(U) - sqr(Umean);
|
||||
Bmean = nm1Coeff*Bmean + nCoeff*sgsModel->B();
|
||||
epsilonMean = nm1Coeff*epsilonMean + nCoeff*sgsModel->epsilon();
|
||||
|
||||
pPrime2Mean += sqr(pMean);
|
||||
pMean = nm1Coeff*pMean + nCoeff*p;
|
||||
pPrime2Mean = nm1Coeff*pPrime2Mean + nCoeff*sqr(p) - sqr(pMean);
|
||||
@ -0,0 +1,14 @@
|
||||
nAveragingSteps++;
|
||||
|
||||
scalar nm1Coeff = scalar(nAveragingSteps - 1)/nAveragingSteps;
|
||||
scalar nCoeff = 1.0/nAveragingSteps;
|
||||
|
||||
R += sqr(Umean);
|
||||
Umean = nm1Coeff*Umean + nCoeff*U;
|
||||
R = nm1Coeff*R + nCoeff*sqr(U) - sqr(Umean);
|
||||
Bmean = nm1Coeff*Bmean + nCoeff*sgsModel->B();
|
||||
epsilonMean = nm1Coeff*epsilonMean + nCoeff*sgsModel->epsilon();
|
||||
|
||||
pPrime2Mean += sqr(pMean);
|
||||
pMean = nm1Coeff*pMean + nCoeff*p;
|
||||
pPrime2Mean = nm1Coeff*pPrime2Mean + nCoeff*sqr(p) - sqr(pMean);
|
||||
@ -0,0 +1,234 @@
|
||||
label nAveragingSteps = 1;
|
||||
|
||||
IFstream nAveragingStepsFile
|
||||
(
|
||||
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
|
||||
);
|
||||
|
||||
|
||||
autoPtr<volVectorField> UmeanPtr;
|
||||
autoPtr<volSymmTensorField> RPtr;
|
||||
autoPtr<volSymmTensorField> BmeanPtr;
|
||||
autoPtr<volScalarField> epsilonMeanPtr;
|
||||
|
||||
autoPtr<volScalarField> pMeanPtr;
|
||||
autoPtr<volScalarField> pPrime2MeanPtr;
|
||||
|
||||
if (nAveragingStepsFile.good())
|
||||
{
|
||||
nAveragingStepsFile >> nAveragingSteps;
|
||||
|
||||
Info<< "Reading field Umean\n" << endl;
|
||||
UmeanPtr.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Umean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "\nReading field R\n" << endl;
|
||||
RPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "\nReading field Bmean\n" << endl;
|
||||
BmeanPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Bmean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "\nReading field epsilonMean\n" << endl;
|
||||
epsilonMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"epsilonMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Reading field pMean\n" << endl;
|
||||
pMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Reading field pPrime2Mean\n" << endl;
|
||||
pPrime2MeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pPrime2Mean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Creating field Umean\n" << endl;
|
||||
UmeanPtr.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Umean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
U
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field R\n" << endl;
|
||||
RPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sqr(U) - sqr(UmeanPtr())
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field Bmean\n" << endl;
|
||||
BmeanPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Bmean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sgsModel->B()
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field epsilonMean\n" << endl;
|
||||
epsilonMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"epsilonMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sgsModel->epsilon()
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field pMean\n" << endl;
|
||||
pMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
p
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field pPrime2Mean\n" << endl;
|
||||
pPrime2MeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pPrime2Mean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sqr(p) - sqr(pMeanPtr())
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
volVectorField& Umean = UmeanPtr();
|
||||
volSymmTensorField& R = RPtr();
|
||||
volSymmTensorField& Bmean = BmeanPtr();
|
||||
volScalarField& epsilonMean = epsilonMeanPtr();
|
||||
|
||||
volScalarField& pMean = pMeanPtr();
|
||||
volScalarField& pPrime2Mean = pPrime2MeanPtr();
|
||||
@ -0,0 +1,234 @@
|
||||
label nAveragingSteps = 1;
|
||||
|
||||
IFstream nAveragingStepsFile
|
||||
(
|
||||
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
|
||||
);
|
||||
|
||||
|
||||
autoPtr<volVectorField> UmeanPtr;
|
||||
autoPtr<volSymmTensorField> RPtr;
|
||||
autoPtr<volSymmTensorField> BmeanPtr;
|
||||
autoPtr<volScalarField> epsilonMeanPtr;
|
||||
|
||||
autoPtr<volScalarField> pMeanPtr;
|
||||
autoPtr<volScalarField> pPrime2MeanPtr;
|
||||
|
||||
if (nAveragingStepsFile.good())
|
||||
{
|
||||
nAveragingStepsFile >> nAveragingSteps;
|
||||
|
||||
Info<< "Reading field Umean\n" << endl;
|
||||
UmeanPtr.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Umean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "\nReading field R\n" << endl;
|
||||
RPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "\nReading field Bmean\n" << endl;
|
||||
BmeanPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Bmean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "\nReading field epsilonMean\n" << endl;
|
||||
epsilonMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"epsilonMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Reading field pMean\n" << endl;
|
||||
pMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Reading field pPrime2Mean\n" << endl;
|
||||
pPrime2MeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pPrime2Mean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Creating field Umean\n" << endl;
|
||||
UmeanPtr.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Umean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
U
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field R\n" << endl;
|
||||
RPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sqr(U) - sqr(UmeanPtr())
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field Bmean\n" << endl;
|
||||
BmeanPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Bmean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sgsModel->B()
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field epsilonMean\n" << endl;
|
||||
epsilonMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"epsilonMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sgsModel->epsilon()
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field pMean\n" << endl;
|
||||
pMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
p
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field pPrime2Mean\n" << endl;
|
||||
pPrime2MeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pPrime2Mean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sqr(p) - sqr(pMeanPtr())
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
volVectorField& Umean = UmeanPtr();
|
||||
volSymmTensorField& R = RPtr();
|
||||
volSymmTensorField& Bmean = BmeanPtr();
|
||||
volScalarField& epsilonMean = epsilonMeanPtr();
|
||||
|
||||
volScalarField& pMean = pMeanPtr();
|
||||
volScalarField& pPrime2Mean = pPrime2MeanPtr();
|
||||
@ -0,0 +1,234 @@
|
||||
label nAveragingSteps = 1;
|
||||
|
||||
IFstream nAveragingStepsFile
|
||||
(
|
||||
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
|
||||
);
|
||||
|
||||
|
||||
autoPtr<volVectorField> UmeanPtr;
|
||||
autoPtr<volSymmTensorField> RPtr;
|
||||
autoPtr<volSymmTensorField> BmeanPtr;
|
||||
autoPtr<volScalarField> epsilonMeanPtr;
|
||||
|
||||
autoPtr<volScalarField> pMeanPtr;
|
||||
autoPtr<volScalarField> pPrime2MeanPtr;
|
||||
|
||||
if (nAveragingStepsFile.good())
|
||||
{
|
||||
nAveragingStepsFile >> nAveragingSteps;
|
||||
|
||||
Info<< "Reading field Umean\n" << endl;
|
||||
UmeanPtr.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Umean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "\nReading field R\n" << endl;
|
||||
RPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "\nReading field Bmean\n" << endl;
|
||||
BmeanPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Bmean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "\nReading field epsilonMean\n" << endl;
|
||||
epsilonMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"epsilonMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Reading field pMean\n" << endl;
|
||||
pMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Reading field pPrime2Mean\n" << endl;
|
||||
pPrime2MeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pPrime2Mean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Creating field Umean\n" << endl;
|
||||
UmeanPtr.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Umean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
U
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field R\n" << endl;
|
||||
RPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"R",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sqr(U) - sqr(UmeanPtr())
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field Bmean\n" << endl;
|
||||
BmeanPtr.reset
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Bmean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sgsModel->B()
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field epsilonMean\n" << endl;
|
||||
epsilonMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"epsilonMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sgsModel->epsilon()
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field pMean\n" << endl;
|
||||
pMeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pMean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
p
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field pPrime2Mean\n" << endl;
|
||||
pPrime2MeanPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pPrime2Mean",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
sqr(p) - sqr(pMeanPtr())
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
volVectorField& Umean = UmeanPtr();
|
||||
volSymmTensorField& R = RPtr();
|
||||
volSymmTensorField& Bmean = BmeanPtr();
|
||||
volScalarField& epsilonMean = epsilonMeanPtr();
|
||||
|
||||
volScalarField& pMean = pMeanPtr();
|
||||
volScalarField& pPrime2Mean = pPrime2MeanPtr();
|
||||
@ -0,0 +1,18 @@
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
OFstream nAveragingStepsFile
|
||||
(
|
||||
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
|
||||
);
|
||||
|
||||
if (nAveragingStepsFile.good())
|
||||
{
|
||||
nAveragingStepsFile << nAveragingSteps << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Cannot open file " << nAveragingStepsFile.name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
OFstream nAveragingStepsFile
|
||||
(
|
||||
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
|
||||
);
|
||||
|
||||
if (nAveragingStepsFile.good())
|
||||
{
|
||||
nAveragingStepsFile << nAveragingSteps << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Cannot open file " << nAveragingStepsFile.name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
OFstream nAveragingStepsFile
|
||||
(
|
||||
runTime.path()/runTime.timeName()/"uniform"/"nAveragingSteps.raw"
|
||||
);
|
||||
|
||||
if (nAveragingStepsFile.good())
|
||||
{
|
||||
nAveragingStepsFile << nAveragingSteps << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Cannot open file " << nAveragingStepsFile.name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I../XiFoam
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -2,7 +2,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -3,7 +3,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -7,7 +7,7 @@ EXE_INC = \
|
||||
-IderivedFvPatchFields/solidWallHeatFluxTemperatureCoupled \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -120,7 +120,7 @@ public:
|
||||
inline const fvMesh& neighbourRegion() const;
|
||||
|
||||
//- Return the neighbour patch ID
|
||||
inline const label neighbourPatchID() const;
|
||||
inline label neighbourPatchID() const;
|
||||
|
||||
//- Return a reference to the neighbour patch
|
||||
inline const fvPatch& neighbourPatch() const;
|
||||
|
||||
@ -55,7 +55,7 @@ inline const Foam::fvMesh& Foam::coupleManager::neighbourRegion() const
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::label Foam::coupleManager::neighbourPatchID() const
|
||||
inline Foam::label Foam::coupleManager::neighbourPatchID() const
|
||||
{
|
||||
return neighbourRegion().boundaryMesh().findPatchID(neighbourPatchName_);
|
||||
}
|
||||
|
||||
@ -2,8 +2,8 @@ EXE_INC = \
|
||||
-I../buoyantFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
|
||||
@ -31,9 +31,9 @@
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/transportModels
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
|
||||
@ -37,9 +37,9 @@
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
Info<< "Reading field rAU if present\n" << endl;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
@ -4,8 +4,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -2,8 +2,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
|
||||
@ -86,10 +86,10 @@
|
||||
// Construct interface from gamma distribution
|
||||
interfaceProperties interface(gamma, U, twoPhaseProperties);
|
||||
|
||||
// Construct LES model
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
// Construct incompressible RAS model
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, twoPhaseProperties)
|
||||
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
|
||||
);
|
||||
|
||||
wordList pcorrTypes(pd.boundaryField().types());
|
||||
|
||||
@ -2,8 +2,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-IphaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
|
||||
@ -3,9 +3,9 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -31,7 +31,7 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace LESmodels
|
||||
namespace LES
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -64,8 +64,10 @@ devOneEqEddy::devOneEqEddy
|
||||
mesh_
|
||||
),
|
||||
|
||||
ck_(LESmodelProperties().lookup("ck"))
|
||||
{}
|
||||
ck_(LESmodelProperties().lookupOrAddDefault("ck", 0.07))
|
||||
{
|
||||
printCoeffs();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
@ -99,7 +101,7 @@ bool devOneEqEddy::read()
|
||||
{
|
||||
if (GenEddyVisc::read())
|
||||
{
|
||||
LESmodelProperties().lookup("ck") >> ck_;
|
||||
LESmodelProperties().readIfPresent<scalar>("ck", ck_);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -112,7 +114,7 @@ bool devOneEqEddy::read()
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace LESmodels
|
||||
} // End namespace LES
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -61,7 +61,7 @@ SourceFiles
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace LESmodels
|
||||
namespace LES
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -76,7 +76,7 @@ class devOneEqEddy
|
||||
|
||||
volScalarField k_;
|
||||
|
||||
dimensionedScalar ck_;
|
||||
scalar ck_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -119,7 +119,7 @@ public:
|
||||
//- Return the effective diffusivity for k
|
||||
tmp<volScalarField> DkEff() const
|
||||
{
|
||||
return tmp<volScalarField>
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
new volScalarField("DkEff", nuSgs_ + nu())
|
||||
);
|
||||
|
||||
@ -4,8 +4,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -3,7 +3,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
twoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
|
||||
|
||||
// Create RAS turbulence model
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phiv, twoPhaseProperties)
|
||||
incompressible::turbulenceModel::New(U, phiv, twoPhaseProperties)
|
||||
);
|
||||
|
||||
@ -3,7 +3,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
interfaceProperties interface(gamma, U, twoPhaseProperties);
|
||||
|
||||
// Construct LES model
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, twoPhaseProperties)
|
||||
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
|
||||
);
|
||||
|
||||
@ -42,24 +42,17 @@ namespace functionEntries
|
||||
(
|
||||
functionEntry,
|
||||
calcEntry,
|
||||
insert,
|
||||
execute,
|
||||
primitiveEntryIstream
|
||||
);
|
||||
|
||||
addToMemberFunctionSelectionTable
|
||||
(
|
||||
functionEntry,
|
||||
calcEntry,
|
||||
insert,
|
||||
dictionaryIstream
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionEntries::calcEntry::insert
|
||||
bool Foam::functionEntries::calcEntry::execute
|
||||
(
|
||||
const dictionary& parentDict,
|
||||
primitiveEntry& entry,
|
||||
@ -75,14 +68,4 @@ bool Foam::functionEntries::calcEntry::insert
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionEntries::calcEntry::insert
|
||||
(
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -69,18 +69,13 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
static bool insert
|
||||
static bool execute
|
||||
(
|
||||
const dictionary& parentDict,
|
||||
primitiveEntry& entry,
|
||||
Istream& is
|
||||
);
|
||||
|
||||
static bool insert
|
||||
(
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -1,17 +1,19 @@
|
||||
/*-------------------------------*- C++ -*---------------------------------*\
|
||||
| ========= |
|
||||
| \\ / OpenFOAM |
|
||||
| \\ / |
|
||||
| \\ / The Open Source CFD Toolbox |
|
||||
| \\/ http://www.OpenFOAM.org |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object testDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
#inputMode merge
|
||||
|
||||
dimensions [ 0 2 -2 0 0 0 0 ];
|
||||
internalField uniform 1;
|
||||
@ -29,7 +31,6 @@ inactive
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
|
||||
boundaryField
|
||||
{
|
||||
Default_Boundary_Region
|
||||
@ -40,6 +41,12 @@ boundaryField
|
||||
inlet_1 { $active }
|
||||
inlet_2 { $inactive }
|
||||
inlet_3 { $inactive }
|
||||
inlet_4 { $inactive }
|
||||
inlet_5 "a primitiveEntry is squashed by a directory entry";
|
||||
inlet_5 { $inactive }
|
||||
inlet_6 { $inactive }
|
||||
inlet_7 { $inactive }
|
||||
inlet_8 { $inactive }
|
||||
|
||||
#include "testDictInc"
|
||||
|
||||
@ -48,8 +55,44 @@ boundaryField
|
||||
type inletOutlet;
|
||||
inletValue $internalField;
|
||||
value #include "value";
|
||||
// error #remove self;
|
||||
x 5;
|
||||
y 6;
|
||||
another #calc{x $x; y $y;};
|
||||
}
|
||||
|
||||
// this should have no effect
|
||||
#remove inactive
|
||||
|
||||
inlet_7 { $active }
|
||||
#inputMode overwrite
|
||||
inlet_8 { $active }
|
||||
}
|
||||
|
||||
// NB: the inputMode has a global scope
|
||||
#inputMode merge
|
||||
#include "testDict2"
|
||||
|
||||
foo
|
||||
{
|
||||
$active
|
||||
}
|
||||
|
||||
bar
|
||||
{
|
||||
$active
|
||||
}
|
||||
|
||||
baz
|
||||
{
|
||||
$active
|
||||
}
|
||||
|
||||
|
||||
// this should work
|
||||
#remove active
|
||||
|
||||
// this should work too
|
||||
#remove ( bar baz )
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
30
applications/test/dictionary/testDict2
Normal file
30
applications/test/dictionary/testDict2
Normal file
@ -0,0 +1,30 @@
|
||||
/*-------------------------------*- C++ -*---------------------------------*\
|
||||
| ========= |
|
||||
| \\ / OpenFOAM |
|
||||
| \\ / |
|
||||
| \\ / The Open Source CFD Toolbox |
|
||||
| \\/ http://www.OpenFOAM.org |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object testDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
boundaryField
|
||||
{
|
||||
Default_Boundary_Region
|
||||
{
|
||||
value $internalField;
|
||||
note "actually a noslip wall";
|
||||
}
|
||||
|
||||
inlet_3 "a primitiveEntry squashes directory entry";
|
||||
}
|
||||
|
||||
#inputMode overwrite
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -1 +1,2 @@
|
||||
uniform 2
|
||||
// the trailing ';' shouldn't actually be there, but shouldn't cause problems
|
||||
uniform 2;
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
# Build optional components (eg, may depend on third-party libraries)
|
||||
set -x
|
||||
|
||||
# run from this directory only
|
||||
cd ${0%/*} || exit 1
|
||||
|
||||
# build libccmio if required
|
||||
if [ ! -e $FOAM_LIBBIN/libccmio.so ]
|
||||
then
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::hashSetUnionEqOp
|
||||
|
||||
Description
|
||||
Union operation to combine hash sets
|
||||
Usage: combineReduce(myWordHashSet, unionEqOp<word>());
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
template<class Type>
|
||||
class hashSetUnionEqOp
|
||||
{
|
||||
public:
|
||||
void operator()(HashSet<Type>& x, const HashSet<Type>& y) const
|
||||
{
|
||||
forAllConstIter(typename HashSet<Type>, y, iter)
|
||||
{
|
||||
x.insert(iter.key());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::hashTableUnionEqOp
|
||||
|
||||
Description
|
||||
Union operation to combine hash sets
|
||||
Usage: combineReduce(myWordHashSet, unionEqOp<word>());
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
template<class Type>
|
||||
class hashTableUnionEqOp
|
||||
{
|
||||
public:
|
||||
void operator()(HashTable<Type>& x, const HashTable<Type>& y) const
|
||||
{
|
||||
forAllConstIter(typename HashTable<Type>, y, iter)
|
||||
{
|
||||
x.insert(iter.key(), iter());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -2,9 +2,9 @@ EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -148,9 +148,14 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
|
||||
if (turbulenceProperties.found("turbulenceModel"))
|
||||
{
|
||||
autoPtr<turbulenceModel> turbulenceModel
|
||||
autoPtr<incompressible::turbulenceModel> turbulenceModel
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New
|
||||
(
|
||||
U,
|
||||
phi,
|
||||
laminarTransport
|
||||
)
|
||||
);
|
||||
|
||||
execFlowFunctionObjects(args, runTime);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/transportModels
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/transportModels
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/transportModels
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
@ -4,9 +4,9 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -100,9 +100,14 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
|
||||
if (turbulenceProperties.found("turbulenceModel"))
|
||||
{
|
||||
autoPtr<turbulenceModel> turbulenceModel
|
||||
autoPtr<incompressible::turbulenceModel> turbulenceModel
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New
|
||||
(
|
||||
U,
|
||||
phi,
|
||||
laminarTransport
|
||||
)
|
||||
);
|
||||
|
||||
PePtr.set
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/transportModels
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/transportModels
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
-I$(LIB_SRC)/transportModels
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -83,9 +83,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
const fvPatchList& patches = mesh.boundary();
|
||||
|
||||
@ -80,27 +80,25 @@ $ECHO "Choose running method: 1)gdb+xterm 2)gdb 3)log 4)xterm+valgrind: \c"
|
||||
read method
|
||||
if [ "$method" -ne 1 -a "$method" -ne 2 -a "$method" -ne 3 -a "$method" -ne 4 ]; then
|
||||
printUsage
|
||||
exit 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$ECHO "Run all processes local or distributed? 1)local 2)remote: \c"
|
||||
read spawn
|
||||
if [ "$spawn" -ne 1 -a "$spawn" -ne 2 ]; then
|
||||
printUsage
|
||||
exit 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check ~/.OpenFOAM-VERSION
|
||||
# check <site>/etc
|
||||
# check <site>/.OpenFOAM-VERSION
|
||||
# check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/
|
||||
# check ~/.$WM_PROJECT/
|
||||
# check <installedProject>/etc/
|
||||
if [ "$WM_PROJECT" ]; then
|
||||
|
||||
: ${FOAM_DOT_DIR:=.$WM_PROJECT-$WM_PROJECT_VERSION}
|
||||
|
||||
for i in \
|
||||
$HOME/$FOAM_DOT_DIR \
|
||||
$HOME/.WM_PROJECT/$WM_PROJECT_VERSION \
|
||||
$HOME/.WM_PROJECT \
|
||||
$WM_PROJECT_DIR/etc \
|
||||
$WM_PROJECT_DIR/$FOAM_DOT_DIR \
|
||||
;
|
||||
do
|
||||
if [ -f "$i/bashrc" ]; then
|
||||
@ -112,7 +110,12 @@ fi
|
||||
|
||||
# Construct test string for remote execution.
|
||||
# Source OpenFOAM settings if OpenFOAM environment not set.
|
||||
sourceFoam='[ "$WM_PROJECT" ] || . '"$sourceFoam"
|
||||
# attempt to preserve the installation directory 'FOAM_INST_DIR'
|
||||
if [ "$FOAM_INST_DIR" ]; then
|
||||
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam"
|
||||
else
|
||||
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam"
|
||||
fi
|
||||
|
||||
echo "**sourceFoam:$sourceFoam"
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
#---------------------------------*- sh -*-------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
#---------------------------------*- sh -*-------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
#---------------------------------*- sh -*-------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
@ -48,6 +47,7 @@ initialiseVariables ()
|
||||
if [ "$VERBOSE" = ON ]; then
|
||||
addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE"
|
||||
fi
|
||||
addCMakeVariable "VTK_USE_TK=FALSE"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
#---------------------------------*- sh -*-------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
|
||||
@ -38,6 +38,12 @@ alias wm32 'setenv WM_ARCH_OPTION 32; source $WM_PROJECT_DIR/etc/cshrc'
|
||||
alias wmSP 'setenv WM_PRECISION_OPTION SP; source $WM_PROJECT_DIR/etc/cshrc'
|
||||
alias wmDP 'setenv WM_PRECISION_OPTION DP; source $WM_PROJECT_DIR/etc/cshrc'
|
||||
|
||||
# Toggle wmakeScheduler on/off
|
||||
# - also need to set WM_HOSTS
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias wmSchedON 'setenv WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler'
|
||||
alias wmSchedOFF 'unsetenv WM_SCHEDULER'
|
||||
|
||||
# Change directory aliases
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias src 'cd $FOAM_SRC'
|
||||
|
||||
@ -38,6 +38,12 @@ alias wm32='export WM_ARCH_OPTION=32; . $WM_PROJECT_DIR/etc/bashrc'
|
||||
alias wmSP='export WM_PRECISION_OPTION=SP; . $WM_PROJECT_DIR/etc/bashrc'
|
||||
alias wmDP='export WM_PRECISION_OPTION=DP; . $WM_PROJECT_DIR/etc/bashrc'
|
||||
|
||||
# Toggle wmakeScheduler on/off
|
||||
# - also need to set WM_HOSTS
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias wmSchedON='export WM_SCHEDULER=$WM_PROJECT_DIR/wmake/wmakeScheduler'
|
||||
alias wmSchedOFF='unset WM_SCHEDULER'
|
||||
|
||||
# Change directory aliases
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias src='cd $FOAM_SRC'
|
||||
|
||||
@ -29,7 +29,6 @@ wmake libso randomProcesses
|
||||
( cd thermophysicalModels && ./Allwmake )
|
||||
( cd transportModels && ./Allwmake )
|
||||
( cd turbulenceModels && ./Allwmake )
|
||||
( cd LESmodels && ./Allwmake )
|
||||
( cd lagrangian && ./Allwmake )
|
||||
( cd postProcessing && ./Allwmake )
|
||||
|
||||
|
||||
@ -213,25 +213,13 @@ bool Foam::chDir(const fileName& dir)
|
||||
|
||||
Foam::fileName Foam::dotFoam(const fileName& name)
|
||||
{
|
||||
// Search for file 'name' in:
|
||||
// 1) ~/.OpenFOAM-VERSION/, ~/.OpenFOAM/VERSION/ or ~/.OpenFOAM/
|
||||
// 2) $WM_PROJECT_INST_DIR/site/VERSION or $WM_PROJECT_INST_DIR/site/
|
||||
// 3) $WM_PROJECT_DIR/etc/
|
||||
|
||||
// Search user files:
|
||||
// ~~~~~~~~~~~~~~~~~~
|
||||
// Check for user file in ~/.OpenFOAM-VERSION/
|
||||
fileName fullName = home()/(word(".OpenFOAM-") + FOAMversion)/name;
|
||||
if (exists(fullName))
|
||||
{
|
||||
return fullName;
|
||||
}
|
||||
|
||||
fileName searchDir = home()/".OpenFOAM";
|
||||
if (dir(searchDir))
|
||||
{
|
||||
// Check for user file in ~/.OpenFOAM/VERSION
|
||||
fullName = searchDir/FOAMversion/name;
|
||||
fileName fullName = searchDir/FOAMversion/name;
|
||||
if (exists(fullName))
|
||||
{
|
||||
return fullName;
|
||||
@ -252,7 +240,7 @@ Foam::fileName Foam::dotFoam(const fileName& name)
|
||||
if (dir(searchDir))
|
||||
{
|
||||
// Check for site file in $WM_PROJECT_INST_DIR/site/VERSION
|
||||
fullName = searchDir/"site"/FOAMversion/name;
|
||||
fileName fullName = searchDir/"site"/FOAMversion/name;
|
||||
if (exists(fullName))
|
||||
{
|
||||
return fullName;
|
||||
@ -272,14 +260,14 @@ Foam::fileName Foam::dotFoam(const fileName& name)
|
||||
if (dir(searchDir))
|
||||
{
|
||||
// Check for shipped OpenFOAM file in $WM_PROJECT_DIR/etc
|
||||
fullName = searchDir/"etc"/name;
|
||||
fileName fullName = searchDir/"etc"/name;
|
||||
if (exists(fullName))
|
||||
{
|
||||
return fullName;
|
||||
}
|
||||
}
|
||||
|
||||
// Nothing found
|
||||
// Not found
|
||||
return fileName::null;
|
||||
}
|
||||
|
||||
|
||||
@ -122,6 +122,7 @@ functionEntries = $(dictionary)/functionEntries
|
||||
$(functionEntries)/functionEntry/functionEntry.C
|
||||
$(functionEntries)/includeEntry/includeEntry.C
|
||||
$(functionEntries)/inputModeEntry/inputModeEntry.C
|
||||
$(functionEntries)/removeEntry/removeEntry.C
|
||||
|
||||
IOdictionary = db/IOobjects/IOdictionary
|
||||
$(IOdictionary)/IOdictionary.C
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/zlib-1.2.3
|
||||
-I$(WM_THIRD_PARTY_DIR)/zlib-1.2.3
|
||||
|
||||
LIB_LIBS = \
|
||||
$(FOAM_LIBBIN)/libOSspecific.o \
|
||||
|
||||
@ -329,12 +329,9 @@ public:
|
||||
// Writing
|
||||
|
||||
//- Write the standard OpenFOAM file/dictionary banner
|
||||
// Optionally without -*- C++ -*- editor hint (eg, for logs)
|
||||
template<class Stream>
|
||||
static inline void writeBanner(Stream& os);
|
||||
|
||||
//- Write the standard OpenFOAM log banner
|
||||
template<class Stream>
|
||||
static inline void writeLogBanner(Stream& os);
|
||||
static inline void writeBanner(Stream& os, bool noHint=false);
|
||||
|
||||
//- Write the standard file section divider
|
||||
template<class Stream>
|
||||
|
||||
@ -29,48 +29,34 @@ License
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Stream>
|
||||
inline void Foam::IOobject::writeBanner(Stream& os)
|
||||
inline void Foam::IOobject::writeBanner(Stream& os, bool noHint)
|
||||
{
|
||||
static bool spacesSet = false;
|
||||
static char spaces[80];
|
||||
static char spaces[40];
|
||||
|
||||
if (!spacesSet)
|
||||
{
|
||||
memset(spaces, ' ', 80);
|
||||
memset(spaces, ' ', 40);
|
||||
spaces[38 - strlen(Foam::FOAMversion)] = '\0';
|
||||
spacesSet = true;
|
||||
}
|
||||
|
||||
os <<
|
||||
"/*--------------------------------*- C++ -*----------------------------------*\\\n"
|
||||
"| ========= | |\n"
|
||||
"| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |\n"
|
||||
"| \\\\ / O peration | Version: " << FOAMversion << spaces << "|\n"
|
||||
"| \\\\ / A nd | Web: http://www.openfoam.org |\n"
|
||||
"| \\\\/ M anipulation | |\n"
|
||||
"\\*---------------------------------------------------------------------------*/\n";
|
||||
}
|
||||
|
||||
|
||||
template<class Stream>
|
||||
inline void Foam::IOobject::writeLogBanner(Stream& os)
|
||||
{
|
||||
static bool spacesSet = false;
|
||||
static char spaces[80];
|
||||
|
||||
if (!spacesSet)
|
||||
if (noHint)
|
||||
{
|
||||
memset(spaces, ' ', 80);
|
||||
spaces[38 - strlen(Foam::FOAMversion)] = '\0';
|
||||
spacesSet = true;
|
||||
os <<
|
||||
"/*---------------------------------------------------------------------------*\\\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
os <<
|
||||
"/*--------------------------------*- C++ -*----------------------------------*\\\n";
|
||||
}
|
||||
|
||||
os <<
|
||||
"/*---------------------------------------------------------------------------*\\\n"
|
||||
"| ========= | |\n"
|
||||
"| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |\n"
|
||||
"| \\\\ / O peration | Version: " << FOAMversion << spaces << "|\n"
|
||||
"| \\\\ / A nd | Web: http://www.openfoam.org |\n"
|
||||
"| \\\\ / A nd | Web: http://www.OpenFOAM.org |\n"
|
||||
"| \\\\/ M anipulation | |\n"
|
||||
"\\*---------------------------------------------------------------------------*/\n";
|
||||
}
|
||||
|
||||
@ -37,8 +37,8 @@ bool Foam::IOobject::writeHeader(Ostream& os) const
|
||||
if (!os.good())
|
||||
{
|
||||
Info<< "IOobject::writeHeader(Ostream&) : "
|
||||
<< "no stream open for write"
|
||||
<< endl << os.info() << endl;
|
||||
<< "no stream open for write" << nl
|
||||
<< os.info() << endl;
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -49,16 +49,14 @@ bool Foam::IOobject::writeHeader(Ostream& os) const
|
||||
<< " format " << os.format() << ";\n"
|
||||
<< " class " << type() << ";\n";
|
||||
|
||||
// outdent for visibility and more space
|
||||
if (note().size())
|
||||
{
|
||||
os << " note " << note() << ";\n";
|
||||
os << " note " << note() << ";\n";
|
||||
}
|
||||
|
||||
// writing without quotes would look nicer
|
||||
os << " object " << name() << ";\n"
|
||||
//<< " instance " << instance()/local() << ";\n"
|
||||
//<< " local " << local() << ";\n"
|
||||
<< " location " << instance()/local() << ";\n"
|
||||
os << " location " << instance()/local() << ";\n"
|
||||
<< " object " << name() << ";\n"
|
||||
<< "}" << nl;
|
||||
|
||||
writeDivider(os);
|
||||
|
||||
@ -34,74 +34,6 @@ defineTypeNameAndDebug(Foam::dictionary, 0);
|
||||
|
||||
const Foam::dictionary Foam::dictionary::null;
|
||||
|
||||
#define DICTIONARY_INPLACE_MERGE
|
||||
|
||||
// * * * * * * * * * * * * * Private member functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::dictionary::add(entry* ePtr, bool mergeEntry)
|
||||
{
|
||||
HashTable<entry*>::iterator iter = hashedEntries_.find(ePtr->keyword());
|
||||
|
||||
if (mergeEntry && iter != hashedEntries_.end())
|
||||
{
|
||||
// merge dictionary with dictionary
|
||||
if (iter()->isDict() && ePtr->isDict())
|
||||
{
|
||||
iter()->dict().merge(ePtr->dict());
|
||||
delete ePtr;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// replace existing dictionary with entry or vice versa
|
||||
#ifdef DICTIONARY_INPLACE_MERGE
|
||||
IDLList<entry>::replace(iter(), ePtr);
|
||||
delete iter();
|
||||
hashedEntries_.erase(iter);
|
||||
|
||||
if (hashedEntries_.insert(ePtr->keyword(), ePtr))
|
||||
{
|
||||
ePtr->name() = name_ + "::" + ePtr->keyword();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IOWarningIn("dictionary::add(entry* ePtr)", (*this))
|
||||
<< "problem replacing entry "<< ePtr->keyword()
|
||||
<< " in dictionary " << name()
|
||||
<< endl;
|
||||
|
||||
IDLList<entry>::remove(ePtr);
|
||||
delete ePtr;
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
remove(ePtr->keyword());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (hashedEntries_.insert(ePtr->keyword(), ePtr))
|
||||
{
|
||||
ePtr->name() = name_ + "::" + ePtr->keyword();
|
||||
IDLList<entry>::append(ePtr);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IOWarningIn("dictionary::add(entry* ePtr)", (*this))
|
||||
<< "attempt to add entry "<< ePtr->keyword()
|
||||
<< " which already exists in dictionary " << name()
|
||||
<< endl;
|
||||
|
||||
delete ePtr;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dictionary::dictionary()
|
||||
@ -195,15 +127,15 @@ Foam::label Foam::dictionary::endLineNumber() const
|
||||
}
|
||||
|
||||
|
||||
bool Foam::dictionary::found(const word& keyword, bool recusive) const
|
||||
bool Foam::dictionary::found(const word& keyword, bool recursive) const
|
||||
{
|
||||
if (hashedEntries_.found(keyword))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (recusive && &parent_ != &dictionary::null)
|
||||
else if (recursive && &parent_ != &dictionary::null)
|
||||
{
|
||||
return parent_.found(keyword, recusive);
|
||||
return parent_.found(keyword, recursive);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -215,16 +147,16 @@ bool Foam::dictionary::found(const word& keyword, bool recusive) const
|
||||
const Foam::entry* Foam::dictionary::lookupEntryPtr
|
||||
(
|
||||
const word& keyword,
|
||||
bool recusive
|
||||
bool recursive
|
||||
) const
|
||||
{
|
||||
HashTable<entry*>::const_iterator iter = hashedEntries_.find(keyword);
|
||||
|
||||
if (iter == hashedEntries_.end())
|
||||
{
|
||||
if (recusive && &parent_ != &dictionary::null)
|
||||
if (recursive && &parent_ != &dictionary::null)
|
||||
{
|
||||
return parent_.lookupEntryPtr(keyword, recusive);
|
||||
return parent_.lookupEntryPtr(keyword, recursive);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -239,19 +171,19 @@ const Foam::entry* Foam::dictionary::lookupEntryPtr
|
||||
Foam::entry* Foam::dictionary::lookupEntryPtr
|
||||
(
|
||||
const word& keyword,
|
||||
bool recusive
|
||||
bool recursive
|
||||
)
|
||||
{
|
||||
HashTable<entry*>::iterator iter = hashedEntries_.find(keyword);
|
||||
|
||||
if (iter == hashedEntries_.end())
|
||||
{
|
||||
if (recusive && &parent_ != &dictionary::null)
|
||||
if (recursive && &parent_ != &dictionary::null)
|
||||
{
|
||||
return const_cast<dictionary&>(parent_).lookupEntryPtr
|
||||
(
|
||||
keyword,
|
||||
recusive
|
||||
recursive
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -267,14 +199,13 @@ Foam::entry* Foam::dictionary::lookupEntryPtr
|
||||
const Foam::entry& Foam::dictionary::lookupEntry
|
||||
(
|
||||
const word& keyword,
|
||||
bool recusive
|
||||
bool recursive
|
||||
) const
|
||||
{
|
||||
const entry* ePtr = lookupEntryPtr(keyword, recusive);
|
||||
const entry* entryPtr = lookupEntryPtr(keyword, recursive);
|
||||
|
||||
if (ePtr == NULL)
|
||||
if (entryPtr == NULL)
|
||||
{
|
||||
// If keyword not found print error message ...
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"dictionary::lookupEntry(const word& keyword) const",
|
||||
@ -284,23 +215,25 @@ const Foam::entry& Foam::dictionary::lookupEntry
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
return *ePtr;
|
||||
return *entryPtr;
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::dictionary::lookup
|
||||
(
|
||||
const word& keyword,
|
||||
bool recusive
|
||||
bool recursive
|
||||
) const
|
||||
{
|
||||
return lookupEntry(keyword, recusive).stream();
|
||||
return lookupEntry(keyword, recursive).stream();
|
||||
}
|
||||
|
||||
|
||||
bool Foam::dictionary::isDict(const word& keyword) const
|
||||
{
|
||||
if (const entry* entryPtr = lookupEntryPtr(keyword))
|
||||
const entry* entryPtr = lookupEntryPtr(keyword);
|
||||
|
||||
if (entryPtr)
|
||||
{
|
||||
return entryPtr->isDict();
|
||||
}
|
||||
@ -313,7 +246,9 @@ bool Foam::dictionary::isDict(const word& keyword) const
|
||||
|
||||
const Foam::dictionary* Foam::dictionary::subDictPtr(const word& keyword) const
|
||||
{
|
||||
if (const entry* entryPtr = lookupEntryPtr(keyword))
|
||||
const entry* entryPtr = lookupEntryPtr(keyword);
|
||||
|
||||
if (entryPtr)
|
||||
{
|
||||
return &entryPtr->dict();
|
||||
}
|
||||
@ -326,13 +261,9 @@ const Foam::dictionary* Foam::dictionary::subDictPtr(const word& keyword) const
|
||||
|
||||
const Foam::dictionary& Foam::dictionary::subDict(const word& keyword) const
|
||||
{
|
||||
if (const entry* entryPtr = lookupEntryPtr(keyword))
|
||||
const entry* entryPtr = lookupEntryPtr(keyword);
|
||||
if (entryPtr == NULL)
|
||||
{
|
||||
return entryPtr->dict();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If keyword not found print error message ...
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"dictionary::subDict(const word& keyword) const",
|
||||
@ -340,37 +271,31 @@ const Foam::dictionary& Foam::dictionary::subDict(const word& keyword) const
|
||||
) << " keyword " << keyword << " is undefined in dictionary "
|
||||
<< name()
|
||||
<< exit(FatalIOError);
|
||||
|
||||
return entryPtr->dict();
|
||||
}
|
||||
return entryPtr->dict();
|
||||
}
|
||||
|
||||
|
||||
Foam::dictionary& Foam::dictionary::subDict(const word& keyword)
|
||||
{
|
||||
if (entry* entryPtr = lookupEntryPtr(keyword))
|
||||
entry* entryPtr = lookupEntryPtr(keyword);
|
||||
if (entryPtr == NULL)
|
||||
{
|
||||
return entryPtr->dict();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If keyword not found print error message ...
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"dictionary::subDict(const word& keyword) const",
|
||||
"dictionary::subDict(const word& keyword)",
|
||||
*this
|
||||
) << " keyword " << keyword << " is undefined in dictionary "
|
||||
<< name()
|
||||
<< exit(FatalIOError);
|
||||
|
||||
return entryPtr->dict();
|
||||
}
|
||||
return entryPtr->dict();
|
||||
}
|
||||
|
||||
|
||||
Foam::wordList Foam::dictionary::toc() const
|
||||
{
|
||||
wordList keywords(size());
|
||||
wordList keys(size());
|
||||
|
||||
label i = 0;
|
||||
for
|
||||
@ -380,56 +305,124 @@ Foam::wordList Foam::dictionary::toc() const
|
||||
++iter
|
||||
)
|
||||
{
|
||||
keywords[i++] = iter().keyword();
|
||||
keys[i++] = iter().keyword();
|
||||
}
|
||||
|
||||
return keywords;
|
||||
return keys;
|
||||
}
|
||||
|
||||
|
||||
void Foam::dictionary::add(const entry& e)
|
||||
bool Foam::dictionary::add(entry* entryPtr, bool mergeEntry)
|
||||
{
|
||||
add(e.clone(*this).ptr());
|
||||
HashTable<entry*>::iterator iter = hashedEntries_.find(entryPtr->keyword());
|
||||
|
||||
if (mergeEntry && iter != hashedEntries_.end())
|
||||
{
|
||||
// merge dictionary with dictionary
|
||||
if (iter()->isDict() && entryPtr->isDict())
|
||||
{
|
||||
iter()->dict().merge(entryPtr->dict());
|
||||
delete entryPtr;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// replace existing dictionary with entry or vice versa
|
||||
IDLList<entry>::replace(iter(), entryPtr);
|
||||
delete iter();
|
||||
hashedEntries_.erase(iter);
|
||||
|
||||
if (hashedEntries_.insert(entryPtr->keyword(), entryPtr))
|
||||
{
|
||||
entryPtr->name() = name_ + "::" + entryPtr->keyword();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IOWarningIn("dictionary::add(entry*)", (*this))
|
||||
<< "problem replacing entry "<< entryPtr->keyword()
|
||||
<< " in dictionary " << name() << endl;
|
||||
|
||||
IDLList<entry>::remove(entryPtr);
|
||||
delete entryPtr;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hashedEntries_.insert(entryPtr->keyword(), entryPtr))
|
||||
{
|
||||
entryPtr->name() = name_ + "::" + entryPtr->keyword();
|
||||
IDLList<entry>::append(entryPtr);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IOWarningIn("dictionary::add(entry* entryPtr)", (*this))
|
||||
<< "attempt to add entry "<< entryPtr->keyword()
|
||||
<< " which already exists in dictionary " << name()
|
||||
<< endl;
|
||||
|
||||
delete entryPtr;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Foam::dictionary::add(const word& keyword, const token& t)
|
||||
|
||||
void Foam::dictionary::add(const entry& e, bool mergeEntry)
|
||||
{
|
||||
add(new primitiveEntry(keyword, t));
|
||||
add(e.clone(*this).ptr(), mergeEntry);
|
||||
}
|
||||
|
||||
void Foam::dictionary::add(const word& keyword, const word& w)
|
||||
void Foam::dictionary::add(const word& k, const word& w, bool overwrite)
|
||||
{
|
||||
add(new primitiveEntry(keyword, token(w)));
|
||||
add(new primitiveEntry(k, token(w)), overwrite);
|
||||
}
|
||||
|
||||
void Foam::dictionary::add(const word& keyword, const Foam::string& s)
|
||||
void Foam::dictionary::add(const word& k, const Foam::string& s, bool overwrite)
|
||||
{
|
||||
add(new primitiveEntry(keyword, token(s)));
|
||||
add(new primitiveEntry(k, token(s)), overwrite);
|
||||
}
|
||||
|
||||
void Foam::dictionary::add(const word& keyword, const label l)
|
||||
void Foam::dictionary::add(const word& k, const label l, bool overwrite)
|
||||
{
|
||||
add(new primitiveEntry(keyword, token(l)));
|
||||
add(new primitiveEntry(k, token(l)), overwrite);
|
||||
}
|
||||
|
||||
void Foam::dictionary::add(const word& keyword, const scalar s)
|
||||
void Foam::dictionary::add(const word& k, const scalar s, bool overwrite)
|
||||
{
|
||||
add(new primitiveEntry(keyword, token(s)));
|
||||
add(new primitiveEntry(k, token(s)), overwrite);
|
||||
}
|
||||
|
||||
void Foam::dictionary::add(const word& keyword, const ITstream& tokens)
|
||||
void Foam::dictionary::add(const word& k, const dictionary& d, bool mergeEntry)
|
||||
{
|
||||
add(new primitiveEntry(keyword, tokens));
|
||||
add(new dictionaryEntry(k, *this, d), mergeEntry);
|
||||
}
|
||||
|
||||
void Foam::dictionary::add(const word& keyword, const tokenList& tokens)
|
||||
|
||||
void Foam::dictionary::set(entry* entryPtr)
|
||||
{
|
||||
add(new primitiveEntry(keyword, tokens));
|
||||
entry* existingPtr = lookupEntryPtr(entryPtr->keyword());
|
||||
|
||||
// clear dictionary so merge acts like overwrite
|
||||
if (existingPtr && existingPtr->isDict())
|
||||
{
|
||||
existingPtr->dict().clear();
|
||||
}
|
||||
add(entryPtr, true);
|
||||
}
|
||||
|
||||
void Foam::dictionary::add(const word& keyword, const dictionary& dict)
|
||||
|
||||
void Foam::dictionary::set(const entry& e)
|
||||
{
|
||||
add(new dictionaryEntry(keyword, *this, dict));
|
||||
set(e.clone(*this).ptr());
|
||||
}
|
||||
|
||||
void Foam::dictionary::set(const word& k, const dictionary& d)
|
||||
{
|
||||
set(new dictionaryEntry(k, *this, d));
|
||||
}
|
||||
|
||||
|
||||
@ -486,7 +479,10 @@ bool Foam::dictionary::changeKeyword
|
||||
}
|
||||
else
|
||||
{
|
||||
// could issue warning if desired
|
||||
WarningIn("dictionary::changeKeyword(const word& old, const word& new)")
|
||||
<< "cannot rename keyword "<< oldKeyword
|
||||
<< " to existing keyword " << newKeyword
|
||||
<< " in dictionary " << name() << endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -527,34 +523,24 @@ bool Foam::dictionary::merge(const dictionary& dict)
|
||||
if (iter2 != hashedEntries_.end())
|
||||
{
|
||||
// Recursively merge sub-dictionaries
|
||||
// TODO: merge without copying
|
||||
if (iter2()->isDict() && iter().isDict())
|
||||
{
|
||||
// without copying and without remove/add?
|
||||
// this certainly looks ugly and doesn't necessarily
|
||||
// retain the original sort order (perhaps nice to have)
|
||||
if
|
||||
(
|
||||
iter2()->dict().merge(iter().dict())
|
||||
)
|
||||
if (iter2()->dict().merge(iter().dict()))
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef DICTIONARY_INPLACE_MERGE
|
||||
add(iter().clone(*this).ptr(), true);
|
||||
#else
|
||||
remove(keyword);
|
||||
add(iter().clone(*this)());
|
||||
#endif
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// not found - just add
|
||||
add(iter().clone(*this)());
|
||||
add(iter().clone(*this).ptr());
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
@ -588,8 +574,8 @@ void Foam::dictionary::operator=(const dictionary& dict)
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Clear the current entries
|
||||
IDLList<entry>::clear();
|
||||
name_ = dict.name();
|
||||
clear();
|
||||
|
||||
// Create clones of the entries in the given dictionary
|
||||
// resetting the parentDict to this dictionary
|
||||
@ -603,10 +589,6 @@ void Foam::dictionary::operator=(const dictionary& dict)
|
||||
IDLList<entry>::append(iter().clone(*this).ptr());
|
||||
}
|
||||
|
||||
name_ = dict.name();
|
||||
|
||||
hashedEntries_.clear();
|
||||
|
||||
for
|
||||
(
|
||||
IDLList<entry>::iterator iter = begin();
|
||||
@ -636,7 +618,7 @@ void Foam::dictionary::operator+=(const dictionary& dict)
|
||||
++iter
|
||||
)
|
||||
{
|
||||
add(iter().clone(*this)());
|
||||
add(iter().clone(*this).ptr());
|
||||
}
|
||||
}
|
||||
|
||||
@ -660,7 +642,7 @@ void Foam::dictionary::operator|=(const dictionary& dict)
|
||||
{
|
||||
if (!found(iter().keyword()))
|
||||
{
|
||||
add(iter().clone(*this)());
|
||||
add(iter().clone(*this).ptr());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -683,8 +665,7 @@ void Foam::dictionary::operator<<=(const dictionary& dict)
|
||||
++iter
|
||||
)
|
||||
{
|
||||
remove(iter().keyword());
|
||||
add(iter().clone(*this)());
|
||||
set(iter().clone(*this).ptr());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -31,8 +31,12 @@ Description
|
||||
|
||||
The dictionary class is the base class for IOdictionary.
|
||||
It serves the purpose of a bootstrap dictionary for the objectRegistry
|
||||
data dictionaries, since unlike the IOdictionary class, it does not use a
|
||||
objectRegistry itself to work.
|
||||
data dictionaries, since unlike the IOdictionary class, it does not use
|
||||
a objectRegistry itself to work.
|
||||
|
||||
ToDo
|
||||
A merge() member function with a non-const dictionary parameter.
|
||||
This would avoid unnecessary cloning in the add(entry*,bool) method
|
||||
|
||||
SourceFiles
|
||||
dictionary.C
|
||||
@ -171,31 +175,50 @@ public:
|
||||
// Search and lookup
|
||||
|
||||
//- Search dictionary for given keyword
|
||||
// If recusive search parent dictionaries
|
||||
bool found(const word& keyword, bool recusive=false) const;
|
||||
// If recursive search parent dictionaries
|
||||
bool found(const word& keyword, bool recursive=false) const;
|
||||
|
||||
//- Find and return an entry data stream pointer if present
|
||||
// otherwise return NULL.
|
||||
// If recusive search parent dictionaries
|
||||
const entry* lookupEntryPtr(const word&, bool recusive=false) const;
|
||||
// If recursive search parent dictionaries
|
||||
const entry* lookupEntryPtr(const word&, bool recursive=false) const;
|
||||
|
||||
//- Find and return an entry data stream pointer for manipulation
|
||||
// if present otherwise return NULL.
|
||||
// If recusive search parent dictionaries
|
||||
entry* lookupEntryPtr(const word&, bool recusive=false);
|
||||
// If recursive search parent dictionaries
|
||||
entry* lookupEntryPtr(const word&, bool recursive=false);
|
||||
|
||||
//- Find and return an entry data stream if present otherwise error.
|
||||
// If recusive search parent dictionaries
|
||||
const entry& lookupEntry(const word&, bool recusive=false) const;
|
||||
// If recursive search parent dictionaries
|
||||
const entry& lookupEntry(const word&, bool recursive=false) const;
|
||||
|
||||
//- Find and return an entry data stream
|
||||
// If recusive search parent dictionaries
|
||||
ITstream& lookup(const word&, bool recusive=false) const;
|
||||
// If recursive search parent dictionaries
|
||||
ITstream& lookup(const word&, bool recursive=false) const;
|
||||
|
||||
//- Find and return a T, if not found return the given default value
|
||||
// If recusive search parent dictionaries
|
||||
// If recursive search parent dictionaries
|
||||
template<class T>
|
||||
T lookupOrDefault(const word&, const T&, bool recusive=false) const;
|
||||
T lookupOrDefault(const word&, const T&, bool recursive=false) const;
|
||||
|
||||
//- Find and return a T, if not found return the given default value,
|
||||
// and add to dictionary. If recusive search parent dictionaries
|
||||
template<class T>
|
||||
T lookupOrAddDefault
|
||||
(
|
||||
const word&,
|
||||
const T&,
|
||||
bool recusive=false
|
||||
);
|
||||
|
||||
//- Find an entry if present, and assign to T
|
||||
template<class T>
|
||||
void readIfPresent
|
||||
(
|
||||
const word&,
|
||||
T&,
|
||||
bool recusive=false
|
||||
) const;
|
||||
|
||||
//- Check if entry is a sub-dictionary
|
||||
bool isDict(const word&) const;
|
||||
@ -217,38 +240,57 @@ public:
|
||||
// Editing
|
||||
|
||||
//- Add a new entry
|
||||
bool add(entry*, bool mergeEntry = false);
|
||||
// With the merge option, dictionaries are interwoven and
|
||||
// primitive entries are overwritten
|
||||
bool add(entry*, bool mergeEntry=false);
|
||||
|
||||
//- Add an entry
|
||||
void add(const entry&);
|
||||
|
||||
//- Add a token entry
|
||||
void add(const word& keyword, const token&);
|
||||
// With the merge option, dictionaries are interwoven and
|
||||
// primitive entries are overwritten
|
||||
void add(const entry&, bool mergeEntry=false);
|
||||
|
||||
//- Add a word entry
|
||||
void add(const word& keyword, const word&);
|
||||
// optionally overwrite an existing entry
|
||||
void add(const word& keyword, const word&, bool overwrite=false);
|
||||
|
||||
//- Add a string entry
|
||||
void add(const word& keyword, const string&);
|
||||
// optionally overwrite an existing entry
|
||||
void add(const word& keyword, const string&, bool overwrite=false);
|
||||
|
||||
//- Add a label entry
|
||||
void add(const word& keyword, const label);
|
||||
// optionally overwrite an existing entry
|
||||
void add(const word& keyword, const label, bool overwrite=false);
|
||||
|
||||
//- Add a scalar entry
|
||||
void add(const word& keyword, const scalar);
|
||||
|
||||
//- Add an entry constructed from a ITstream
|
||||
void add(const word& keyword, const ITstream&);
|
||||
|
||||
//- Add an entry constructed from a tokenList
|
||||
void add(const word& keyword, const tokenList& tokens);
|
||||
|
||||
//- Add a T entry
|
||||
template<class T>
|
||||
void add(const word& keyword, const T&);
|
||||
// optionally overwrite an existing entry
|
||||
void add (const word& keyword, const scalar, bool overwrite=false);
|
||||
|
||||
//- Add a dictionary entry
|
||||
void add(const word& keyword, const dictionary&);
|
||||
// optionally merge with an existing sub-dictionary
|
||||
void add
|
||||
(
|
||||
const word& keyword,
|
||||
const dictionary&,
|
||||
bool mergeEntry=false
|
||||
);
|
||||
|
||||
//- Add a T entry
|
||||
// optionally overwrite an existing entry
|
||||
template<class T>
|
||||
void add(const word& keyword, const T&, bool overwrite=false);
|
||||
|
||||
//- Assign a new entry, overwrite any existing entry
|
||||
void set(entry*);
|
||||
|
||||
//- Assign a new entry, overwrite any existing entry
|
||||
void set(const entry&);
|
||||
|
||||
//- Assign a dictionary entry, overwrite any existing entry
|
||||
void set(const word& keyword, const dictionary&);
|
||||
|
||||
//- Assign a T entry, overwrite any existing entry
|
||||
template<class T>
|
||||
void set(const word& keyword, const T&);
|
||||
|
||||
//- Remove an entry specified by keyword
|
||||
bool remove(const word& keyword);
|
||||
@ -307,14 +349,12 @@ public:
|
||||
|
||||
// Global Operators
|
||||
|
||||
// Combine dictionaries starting from the entries in dict one and then including
|
||||
// those from dict2.
|
||||
// Warn, but do not overwrite the entries from dict1.
|
||||
//- Combine dictionaries starting from the entries in dict1 and then including those from dict2.
|
||||
// Warn, but do not overwrite the entries from dict1.
|
||||
dictionary operator+(const dictionary& dict1, const dictionary& dict2);
|
||||
|
||||
// Combine dictionaries starting from the entries in dict one and then including
|
||||
// those from dict2.
|
||||
// Do not overwrite the entries from dict1.
|
||||
//- Combine dictionaries starting from the entries in dict1 and then including those from dict2.
|
||||
// Do not overwrite the entries from dict1.
|
||||
dictionary operator|(const dictionary& dict1, const dictionary& dict2);
|
||||
|
||||
|
||||
|
||||
@ -31,16 +31,41 @@ License
|
||||
|
||||
template<class T>
|
||||
T Foam::dictionary::lookupOrDefault
|
||||
(
|
||||
const word& keyword,
|
||||
const T& deflt,
|
||||
bool recursive
|
||||
) const
|
||||
{
|
||||
const entry* entryPtr = lookupEntryPtr(keyword, recursive);
|
||||
|
||||
if (entryPtr == NULL)
|
||||
{
|
||||
return deflt;
|
||||
}
|
||||
else
|
||||
{
|
||||
return pTraits<T>(entryPtr->stream());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
T Foam::dictionary::lookupOrAddDefault
|
||||
(
|
||||
const word& keyword,
|
||||
const T& deft,
|
||||
bool recusive
|
||||
) const
|
||||
)
|
||||
{
|
||||
const entry* ePtr = lookupEntryPtr(keyword, recusive);
|
||||
|
||||
if (ePtr == NULL)
|
||||
{
|
||||
entry* defPtr = new primitiveEntry(keyword, deft);
|
||||
append(defPtr);
|
||||
hashedEntries_.insert(defPtr->keyword(), defPtr);
|
||||
|
||||
return deft;
|
||||
}
|
||||
else
|
||||
@ -51,12 +76,33 @@ T Foam::dictionary::lookupOrDefault
|
||||
|
||||
|
||||
template<class T>
|
||||
void Foam::dictionary::add(const word& keyword, const T& t)
|
||||
void Foam::dictionary::readIfPresent
|
||||
(
|
||||
const word& keyword,
|
||||
T& deft,
|
||||
bool recusive
|
||||
) const
|
||||
{
|
||||
entry* ePtr = new primitiveEntry(keyword, t);
|
||||
append(ePtr);
|
||||
hashedEntries_.insert(ePtr->keyword(), ePtr);
|
||||
const entry* ePtr = lookupEntryPtr(keyword, recusive);
|
||||
|
||||
if (ePtr != NULL)
|
||||
{
|
||||
ePtr->stream() >> deft;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
void Foam::dictionary::add(const word& k, const T& t, bool overwrite)
|
||||
{
|
||||
add(new primitiveEntry(k, t), overwrite);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
void Foam::dictionary::set(const word& k, const T& t)
|
||||
{
|
||||
set(new primitiveEntry(k, t));
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -96,7 +96,7 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
|
||||
if (keyword[0] == '#') // ... Function entry
|
||||
{
|
||||
word functionName = keyword(1, keyword.size()-1);
|
||||
return functionEntry::insert(functionName, parentDict, is);
|
||||
return functionEntry::execute(functionName, parentDict, is);
|
||||
}
|
||||
else if (keyword[0] == '$') // ... Substitution entry
|
||||
{
|
||||
@ -105,7 +105,7 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
|
||||
}
|
||||
else if (keyword == "include") // ... For backward compatibility
|
||||
{
|
||||
return functionEntries::includeEntry::insert(parentDict, is);
|
||||
return functionEntries::includeEntry::execute(parentDict, is);
|
||||
}
|
||||
else // ... Data entries
|
||||
{
|
||||
@ -114,12 +114,18 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
|
||||
|
||||
// Deal with duplicate entries
|
||||
bool mergeEntry = false;
|
||||
if (parentDict.found(keyword))
|
||||
|
||||
entry* existingPtr = parentDict.lookupEntryPtr(keyword);
|
||||
if (existingPtr)
|
||||
{
|
||||
if (functionEntries::inputModeEntry::overwrite())
|
||||
{
|
||||
// silently drop previous entries
|
||||
parentDict.remove(keyword);
|
||||
// clear dictionary so merge acts like overwrite
|
||||
if (existingPtr->isDict())
|
||||
{
|
||||
existingPtr->dict().clear();
|
||||
}
|
||||
mergeEntry = true;
|
||||
}
|
||||
else if (functionEntries::inputModeEntry::merge())
|
||||
{
|
||||
|
||||
@ -33,22 +33,66 @@ namespace Foam
|
||||
defineMemberFunctionSelectionTable
|
||||
(
|
||||
functionEntry,
|
||||
insert,
|
||||
primitiveEntryIstream
|
||||
execute,
|
||||
dictionaryIstream
|
||||
);
|
||||
|
||||
defineMemberFunctionSelectionTable
|
||||
(
|
||||
functionEntry,
|
||||
insert,
|
||||
dictionaryIstream
|
||||
execute,
|
||||
primitiveEntryIstream
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Member Function Selectors * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionEntry::insert
|
||||
bool Foam::functionEntry::execute
|
||||
(
|
||||
const word& functionName,
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
is.fatalCheck
|
||||
(
|
||||
"functionEntry::execute"
|
||||
"(const word& functionName, dictionary& parentDict, Istream& is)"
|
||||
);
|
||||
|
||||
if (!executedictionaryIstreamMemberFunctionTablePtr_)
|
||||
{
|
||||
cerr<<"functionEntry::execute"
|
||||
<< "(const word&, dictionary&, Istream&)"
|
||||
<< " not yet initialized, function = "
|
||||
<< functionName.c_str() << std::endl;
|
||||
|
||||
// Return true to keep reading
|
||||
return true;
|
||||
}
|
||||
|
||||
executedictionaryIstreamMemberFunctionTable::iterator mfIter =
|
||||
executedictionaryIstreamMemberFunctionTablePtr_->find(functionName);
|
||||
|
||||
if (mfIter == executedictionaryIstreamMemberFunctionTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"functionEntry::execute"
|
||||
"(const word& functionName, dictionary& parentDict, Istream&)"
|
||||
) << "Unknown functionEntry " << functionName
|
||||
<< endl << endl
|
||||
<< "Valid functionEntries are :" << endl
|
||||
<< executedictionaryIstreamMemberFunctionTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return mfIter()(parentDict, is);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionEntry::execute
|
||||
(
|
||||
const word& functionName,
|
||||
const dictionary& parentDict,
|
||||
@ -58,14 +102,14 @@ bool Foam::functionEntry::insert
|
||||
{
|
||||
is.fatalCheck
|
||||
(
|
||||
"functionEntry::insert"
|
||||
"functionEntry::execute"
|
||||
"(const word& functionName, const dictionary& parentDict, "
|
||||
"primitiveEntry& entry, Istream& is)"
|
||||
"primitiveEntry&, Istream&)"
|
||||
);
|
||||
|
||||
if (!insertprimitiveEntryIstreamMemberFunctionTablePtr_)
|
||||
if (!executeprimitiveEntryIstreamMemberFunctionTablePtr_)
|
||||
{
|
||||
cerr<<"functionEntry::insert"
|
||||
cerr<<"functionEntry::execute"
|
||||
<< "(const word&, dictionary&, primitiveEntry&, Istream&)"
|
||||
<< " not yet initialized, function = "
|
||||
<< functionName.c_str() << std::endl;
|
||||
@ -74,69 +118,24 @@ bool Foam::functionEntry::insert
|
||||
return true;
|
||||
}
|
||||
|
||||
insertprimitiveEntryIstreamMemberFunctionTable::iterator mfIter =
|
||||
insertprimitiveEntryIstreamMemberFunctionTablePtr_->find(functionName);
|
||||
executeprimitiveEntryIstreamMemberFunctionTable::iterator mfIter =
|
||||
executeprimitiveEntryIstreamMemberFunctionTablePtr_->find(functionName);
|
||||
|
||||
if (mfIter == insertprimitiveEntryIstreamMemberFunctionTablePtr_->end())
|
||||
if (mfIter == executeprimitiveEntryIstreamMemberFunctionTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"functionEntry::insert"
|
||||
"functionEntry::execute"
|
||||
"(const word& functionName, const dictionary& parentDict, "
|
||||
"primitiveEntry& entry, Istream& is)"
|
||||
"primitiveEntry&, Istream&)"
|
||||
) << "Unknown functionEntry " << functionName
|
||||
<< endl << endl
|
||||
<< "Valid functionEntries are :" << endl
|
||||
<< insertprimitiveEntryIstreamMemberFunctionTablePtr_->toc()
|
||||
<< executeprimitiveEntryIstreamMemberFunctionTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return mfIter()(parentDict, entry, is);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionEntry::insert
|
||||
(
|
||||
const word& functionName,
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
is.fatalCheck
|
||||
(
|
||||
"functionEntry::insert"
|
||||
"(const word& functionName, dictionary& parentDict, Istream& is)"
|
||||
);
|
||||
|
||||
if (!insertdictionaryIstreamMemberFunctionTablePtr_)
|
||||
{
|
||||
cerr<<"functionEntry::insert"
|
||||
<< "(const word&, dictionary&, Istream&)"
|
||||
<< " not yet initialized, function = "
|
||||
<< functionName.c_str() << std::endl;
|
||||
|
||||
// Return true to keep reading
|
||||
return true;
|
||||
}
|
||||
|
||||
insertdictionaryIstreamMemberFunctionTable::iterator mfIter =
|
||||
insertdictionaryIstreamMemberFunctionTablePtr_->find(functionName);
|
||||
|
||||
if (mfIter == insertdictionaryIstreamMemberFunctionTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"functionEntry::insert"
|
||||
"(const word& functionName, dictionary& parentDict, Istream& is)"
|
||||
) << "Unknown functionEntry " << functionName
|
||||
<< endl << endl
|
||||
<< "Valid functionEntries are :" << endl
|
||||
<< insertdictionaryIstreamMemberFunctionTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return mfIter()(parentDict, is);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -33,13 +33,10 @@ Class
|
||||
Foam::functionEntry
|
||||
|
||||
Description
|
||||
A function entry causes entries to be added/manipulated on the specified
|
||||
A functionEntry causes entries to be added/manipulated on the specified
|
||||
dictionary given an input stream.
|
||||
|
||||
In dictionaries, a @c \# sigil is typically used for a functionEntry.
|
||||
|
||||
See Also
|
||||
functionEntries::includeEntry and functionEntries::inputModeEntry
|
||||
In dictionaries, a @c '\#' sigil is typically used for a functionEntry.
|
||||
|
||||
SourceFiles
|
||||
functionEntry.C
|
||||
@ -84,7 +81,28 @@ public:
|
||||
(
|
||||
bool,
|
||||
functionEntry,
|
||||
insert,
|
||||
execute,
|
||||
dictionaryIstream,
|
||||
(
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
),
|
||||
(parentDict, is)
|
||||
);
|
||||
|
||||
//- Execute the functionEntry in a sub-dict context
|
||||
static bool execute
|
||||
(
|
||||
const word& functionName,
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
);
|
||||
|
||||
declareMemberFunctionSelectionTable
|
||||
(
|
||||
bool,
|
||||
functionEntry,
|
||||
execute,
|
||||
primitiveEntryIstream,
|
||||
(
|
||||
const dictionary& parentDict,
|
||||
@ -94,7 +112,8 @@ public:
|
||||
(parentDict, entry, is)
|
||||
);
|
||||
|
||||
static bool insert
|
||||
//- Execute the functionEntry in a primitiveEntry context
|
||||
static bool execute
|
||||
(
|
||||
const word& functionName,
|
||||
const dictionary& parentDict,
|
||||
@ -103,25 +122,6 @@ public:
|
||||
);
|
||||
|
||||
|
||||
declareMemberFunctionSelectionTable
|
||||
(
|
||||
bool,
|
||||
functionEntry,
|
||||
insert,
|
||||
dictionaryIstream,
|
||||
(
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
),
|
||||
(parentDict, is)
|
||||
);
|
||||
|
||||
static bool insert
|
||||
(
|
||||
const word& functionName,
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user