Commit 6574570b authored by henry's avatar henry
Browse files

Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

Conflicts:
	tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/polyMesh/boundary
	tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/rho
	tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/polyMesh/boundary
	tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/topAir/RASProperties
	tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/topAir/thermophysicalProperties
	tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/topAir/turbulenceProperties
	tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/cp
	tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/rho
	tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/polyMesh/boundary
	tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/fixedInlet
	tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/sideAndTopPatches
	tutorials/incompressible/simpleFoam/windTurbineTerrain/0/nut
	tutorials/incompressible/simpleFoam/windTurbineTerrain/0/p
	tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/RASProperties
	tutorials/incompressible/simpleFoam/windTurbineTerrain/system/decomposeParDict
parents ccfb6e32 1845122f
......@@ -50,199 +50,17 @@ PDRkEpsilon::PDRkEpsilon
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName,
const word& modelName
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),
Cmu_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Cmu",
coeffDict_,
0.09
)
),
C1_
(
dimensioned<scalar>::lookupOrAddToDict
(
"C1",
coeffDict_,
1.44
)
),
C2_
(
dimensioned<scalar>::lookupOrAddToDict
(
"C2",
coeffDict_,
1.92
)
),
sigmak_
(
dimensioned<scalar>::lookupOrAddToDict
(
"sigmak",
coeffDict_,
1.0
)
),
sigmaEps_
(
dimensioned<scalar>::lookupOrAddToDict
(
"sigmaEps",
coeffDict_,
1.3
)
),
Prt_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Prt",
coeffDict_,
1.0
)
),
k_
(
IOobject
(
"k",
runTime_.timeName(),
mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
autoCreateK("k", mesh_)
),
epsilon_
(
IOobject
(
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
autoCreateEpsilon("epsilon", mesh_)
),
mut_
(
IOobject
(
"mut",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
autoCreateMut("mut", mesh_)
),
alphat_
(
IOobject
(
"alphat",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateAlphat("alphat", mesh_)
)
{
bound(epsilon_, epsilonMin_);
mut_ = Cmu_*rho_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
alphat_.correctBoundaryConditions();
printCoeffs();
}
kEpsilon(rho, U, phi, thermophysicalModel, turbulenceModelName, modelName)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<volSymmTensorField> PDRkEpsilon::R() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"R",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
((2.0/3.0)*I)*k_ - (mut_/rho_)*dev(twoSymm(fvc::grad(U_))),
k_.boundaryField().types()
)
);
}
tmp<volSymmTensorField> PDRkEpsilon::devRhoReff() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"devRhoReff",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
-muEff()*dev(twoSymm(fvc::grad(U_)))
)
);
}
tmp<fvVectorMatrix> PDRkEpsilon::divDevRhoReff(volVectorField& U) const
{
return
(
- fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
);
}
bool PDRkEpsilon::read()
{
if (RASModel::read())
{
Cmu_.readIfPresent(coeffDict_);
C1_.readIfPresent(coeffDict_);
C2_.readIfPresent(coeffDict_);
sigmak_.readIfPresent(coeffDict());
sigmaEps_.readIfPresent(coeffDict());
Prt_.readIfPresent(coeffDict());
return true;
}
else
{
return false;
}
}
void PDRkEpsilon::correct()
{
if (!turbulence_)
......@@ -271,7 +89,7 @@ void PDRkEpsilon::correct()
volScalarField G("RASModel::G", mut_*(tgradU() && dev(twoSymm(tgradU()))));
tgradU.clear();
// Update espsilon and G at the wall
// Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs();
// Add the blockage generation term so that it is included consistently
......@@ -320,6 +138,7 @@ void PDRkEpsilon::correct()
solve(kEqn);
bound(k_, kMin_);
// Re-calculate viscosity
mut_ = rho_*Cmu_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -25,12 +25,13 @@ Class
Foam::compressible::RASModels::PDRkEpsilon
Description
Standard k-epsilon turbulence model with additional source terms
Standard k-epsilon turbulence model for compressible flow
with additional source terms
corresponding to PDR basic drag model (\link basic.H \endlink)
The default model coefficients correspond to the following:
@verbatim
kEpsilonCoeffs
PDRkEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
......@@ -53,7 +54,6 @@ Description
SourceFiles
PDRkEpsilon.C
PDRkEpsilonCorrect.C
\*---------------------------------------------------------------------------*/
......@@ -61,6 +61,7 @@ SourceFiles
#define compressiblePDRkEpsilon_H
#include "RASModel.H"
#include "kEpsilon.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -77,26 +78,8 @@ namespace RASModels
class PDRkEpsilon
:
public RASModel
public kEpsilon
{
// Private data
// Model coefficients
dimensionedScalar Cmu_;
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar sigmak_;
dimensionedScalar sigmaEps_;
dimensionedScalar Prt_;
// Fields
volScalarField k_;
volScalarField epsilon_;
volScalarField mut_;
volScalarField alphat_;
public:
......@@ -112,7 +95,9 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel
const basicThermo& thermophysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName,
const word& modelName = typeName
);
......@@ -123,62 +108,9 @@ public:
// Member Functions
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const
{
return tmp<volScalarField>
(
new volScalarField("DkEff", mut_/sigmak_ + mu())
);
}
//- Return the effective diffusivity for epsilon
tmp<volScalarField> DepsilonEff() const
{
return tmp<volScalarField>
(
new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu())
);
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> mut() const
{
return mut_;
}
//- Return the turbulence thermal diffusivity
virtual tmp<volScalarField> alphat() const
{
return alphat_;
}
//- Return the turbulence kinetic energy
virtual tmp<volScalarField> k() const
{
return k_;
}
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const
{
return epsilon_;
}
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
//- Read turbulenceProperties dictionary
virtual bool read();
};
......
......@@ -6,10 +6,12 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel
EXE_LIBS = \
-lbasicThermophysicalModels \
-lbasicSolidThermo \
-lspecie \
-lcompressibleRASModels \
-lcompressibleLESModels \
......
......@@ -37,6 +37,7 @@ Description
#include "regionProperties.H"
#include "compressibleCourantNo.H"
#include "solidRegionDiffNo.H"
#include "basicSolidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
......@@ -14,5 +15,6 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lbasicThermophysicalModels \
-lbasicSolidThermo \
-lspecie \
-lcompressibleRASModels
......@@ -35,6 +35,7 @@ Description
#include "fixedGradientFvPatchFields.H"
#include "regionProperties.H"
#include "compressibleCourantNo.H"
#include "basicSolidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
// Initialise solid field pointer lists
PtrList<volScalarField> rhos(solidRegions.size());
PtrList<volScalarField> cps(solidRegions.size());
PtrList<volScalarField> Ks(solidRegions.size());
PtrList<volScalarField> Ts(solidRegions.size());
PtrList<basicSolidThermo> thermos(solidRegions.size());
// Populate solid field pointer lists
forAll(solidRegions, i)
......@@ -10,75 +7,10 @@
Info<< "*** Reading solid mesh thermophysical properties for region "
<< solidRegions[i].name() << nl << endl;
Info<< " Adding to rhos\n" << endl;
rhos.set
Info<< " Adding to thermos\n" << endl;
thermos.set
(
i,
new volScalarField
(
IOobject
(
"rho",
runTime.timeName(),
solidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
solidRegions[i]
)
);
Info<< " Adding to cps\n" << endl;
cps.set
(
i,
new volScalarField
(
IOobject
(
"cp",
runTime.timeName(),
solidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
solidRegions[i]
)
);
Info<< " Adding to Ks\n" << endl;
Ks.set
(
i,
new volScalarField
(
IOobject
(
"K",
runTime.timeName(),
solidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
solidRegions[i]
)
);
Info<< " Adding to Ts\n" << endl;
Ts.set
(
i,
new volScalarField
(
IOobject
(
"T",
runTime.timeName(),
solidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
solidRegions[i]
)
basicSolidThermo::New(solidRegions[i])
);
}
fvMesh& mesh = solidRegions[i];
basicSolidThermo& thermo = thermos[i];
volScalarField& rho = rhos[i];
volScalarField& cp = cps[i];
volScalarField& K = Ks[i];
volScalarField& T = Ts[i];
tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho();
tmp<volScalarField> tcp = thermo.cp();
const volScalarField& cp = tcp();
tmp<volScalarField> tK = thermo.K();
//tmp<volSymmTensorField> tK = thermo.directionalK();
const volScalarField& K = tK();
volScalarField& T = thermo.T();
<
// Initialise solid field pointer lists
PtrList<volScalarField> rhos(solidRegions.size());
PtrList<volScalarField> cps(solidRegions.size());
PtrList<volScalarField> Ks(solidRegions.size());
PtrList<volScalarField> Ts(solidRegions.size());
PtrList<basicSolidThermo> thermos(solidRegions.size());
// Populate solid field pointer lists
forAll(solidRegions, i)
......@@ -10,75 +7,10 @@
Info<< "*** Reading solid mesh thermophysical properties for region "
<< solidRegions[i].name() << nl << endl;
Info<< " Adding to rhos\n" << endl;
rhos.set
Info<< " Adding to thermos\n" << endl;
thermos.set
(
i,
new volScalarField
(
IOobject
(
"rho",
runTime.timeName(),
solidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
solidRegions[i]
)
);
Info<< " Adding to cps\n" << endl;
cps.set
(
i,
new volScalarField
(
IOobject
(
"cp",
runTime.timeName(),
solidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
solidRegions[i]
)
);
Info<< " Adding to Ks\n" << endl;
Ks.set
(
i,
new volScalarField
(
IOobject
(
"K",
runTime.timeName(),
solidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
solidRegions[i]