Commit 2e77a6f9 authored by Mark Olesen's avatar Mark Olesen
Browse files

Merge commit 'OpenCFD/master' into olesenm

parents b4c93398 8336c33a
......@@ -136,7 +136,7 @@ void buoyantPressureFvPatchScalarField::updateCoeffs()
void buoyantPressureFvPatchScalarField::write(Ostream& os) const
{
fixedGradientFvPatchScalarField::write(os);
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntry("value", os);
}
......
......@@ -159,14 +159,8 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchField<vector>::write(os);
os.writeKeyword("flowRate") << flowRate_ << token::END_STATEMENT << nl;
if (phiName_ != "phi")
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (rhoName_ != "rho")
{
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
}
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntry("value", os);
}
......
......@@ -15,7 +15,7 @@ vanDriestDelta/vanDriestDelta.C
wallFunctions=derivedFvPatchFields/wallFunctions
muSgsWallFunctions=$(wallFunctions)/muSgsWallFunctions
$(muSgsWallFunctions)/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C
$(muSgsWallFunctions)/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C
alphaSgsWallFunctions=$(wallFunctions)/alphaSgsWallFunctions
$(alphaSgsWallFunctions)/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
......
......@@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "muSgsWallFunctionFvPatchScalarField.H"
#include "muSgsUSpaldingWallFunctionFvPatchScalarField.H"
#include "LESModel.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
......@@ -41,7 +41,8 @@ namespace LESModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField::
muSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
......@@ -56,9 +57,10 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
{}
muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField::
muSgsUSpaldingWallFunctionFvPatchScalarField
(
const muSgsWallFunctionFvPatchScalarField& ptf,
const muSgsUSpaldingWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
......@@ -73,7 +75,8 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
{}
muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField::
muSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
......@@ -89,9 +92,10 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
{}
muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField::
muSgsUSpaldingWallFunctionFvPatchScalarField
(
const muSgsWallFunctionFvPatchScalarField& mwfpsf
const muSgsUSpaldingWallFunctionFvPatchScalarField& mwfpsf
)
:
fixedValueFvPatchScalarField(mwfpsf),
......@@ -103,9 +107,10 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
{}
muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField::
muSgsUSpaldingWallFunctionFvPatchScalarField
(
const muSgsWallFunctionFvPatchScalarField& mwfpsf,
const muSgsUSpaldingWallFunctionFvPatchScalarField& mwfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
......@@ -120,7 +125,7 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void muSgsWallFunctionFvPatchScalarField::evaluate
void muSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
(
const Pstream::commsTypes
)
......@@ -190,7 +195,7 @@ void muSgsWallFunctionFvPatchScalarField::evaluate
}
void muSgsWallFunctionFvPatchScalarField::write(Ostream& os) const
void muSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_);
......@@ -207,7 +212,7 @@ void muSgsWallFunctionFvPatchScalarField::write(Ostream& os) const
makePatchTypeField
(
fvPatchScalarField,
muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -24,18 +24,19 @@ License
Class
Foam::compressible::LESModels::
muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField
Description
Spalart Allmaas wall function boundary condition for compressible flows
Wall function boundary condition for walls, based on velocity, using
Spaldings law to give a continuous muSgs profile to the wall (y+ = 0).
SourceFiles
muSgsWallFunctionFvPatchScalarField.C
muSgsUSpaldingWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef muSgsWallFunctionFvPatchScalarField_H
#define muSgsWallFunctionFvPatchScalarField_H
#ifndef muSgsUSpaldingWallFunctionFvPatchScalarField_H
#define muSgsUSpaldingWallFunctionFvPatchScalarField_H
#include "fixedValueFvPatchFields.H"
......@@ -49,10 +50,10 @@ namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class muSgsWallFunctionFvPatchScalarField Declaration
Class muSgsUSpaldingWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class muSgsWallFunctionFvPatchScalarField
class muSgsUSpaldingWallFunctionFvPatchScalarField
:
public fixedValueFvPatchScalarField
{
......@@ -77,20 +78,20 @@ class muSgsWallFunctionFvPatchScalarField
public:
//- Runtime type information
TypeName("muSgsWallFunction");
TypeName("muSgsUSpaldingWallFunction");
// Constructors
//- Construct from patch and internal field
muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
......@@ -98,20 +99,20 @@ public:
);
//- Construct by mapping given
// muSgsWallFunctionFvPatchScalarField
// muSgsUSpaldingWallFunctionFvPatchScalarField
// onto a new patch
muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField
(
const muSgsWallFunctionFvPatchScalarField&,
const muSgsUSpaldingWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField
(
const muSgsWallFunctionFvPatchScalarField&
const muSgsUSpaldingWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
......@@ -119,14 +120,14 @@ public:
{
return tmp<fvPatchScalarField>
(
new muSgsWallFunctionFvPatchScalarField(*this)
new muSgsUSpaldingWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
muSgsWallFunctionFvPatchScalarField
muSgsUSpaldingWallFunctionFvPatchScalarField
(
const muSgsWallFunctionFvPatchScalarField&,
const muSgsUSpaldingWallFunctionFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
......@@ -138,11 +139,7 @@ public:
{
return tmp<fvPatchScalarField>
(
new muSgsWallFunctionFvPatchScalarField
(
*this,
iF
)
new muSgsUSpaldingWallFunctionFvPatchScalarField(*this, iF)
);
}
......
......@@ -111,10 +111,17 @@ alphatWallFunctionFvPatchScalarField
void alphatWallFunctionFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const scalarField& mutw =
patch().lookupPatchField<volScalarField, scalar>(mutName_);
operator==(mutw/Prt_);
fixedValueFvPatchScalarField::updateCoeffs();
}
......
......@@ -169,6 +169,11 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField
void epsilonWallFunctionFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar Cmu25 = pow(Cmu_, 0.25);
......@@ -224,6 +229,8 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs()
}
}
fixedInternalValueFvPatchField<scalar>::updateCoeffs();
// TODO: perform averaging for cells sharing more than one boundary face
}
......
......@@ -191,6 +191,11 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
void mutkWallFunctionFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
operator==(calcMut());
fixedValueFvPatchScalarField::updateCoeffs();
......
......@@ -169,6 +169,11 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
void omegaWallFunctionFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_);
const scalarField& y = rasModel.y()[patch().index()];
......@@ -222,6 +227,8 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
}
}
fixedInternalValueFvPatchField<scalar>::updateCoeffs();
// TODO: perform averaging for cells sharing more than one boundary face
}
......
......@@ -32,7 +32,7 @@ kOmegaSSTSAS/kOmegaSSTSAS.C
wallFunctions=derivedFvPatchFields/wallFunctions
nuSgsWallFunctions=$(wallFunctions)/nuSgsWallFunctions
$(nuSgsWallFunctions)/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C
$(nuSgsWallFunctions)/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libincompressibleLESModels
......@@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "nuSgsWallFunctionFvPatchScalarField.H"
#include "nuSgsUSpaldingWallFunctionFvPatchScalarField.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
......@@ -40,8 +40,8 @@ namespace LESModels
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
nuSgsWallFunctionFvPatchScalarField::
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField::
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
......@@ -55,10 +55,10 @@ nuSgsWallFunctionFvPatchScalarField
{}
nuSgsWallFunctionFvPatchScalarField::
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField::
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsWallFunctionFvPatchScalarField& ptf,
const nuSgsUSpaldingWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
......@@ -72,8 +72,8 @@ nuSgsWallFunctionFvPatchScalarField
{}
nuSgsWallFunctionFvPatchScalarField::
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField::
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
......@@ -88,10 +88,10 @@ nuSgsWallFunctionFvPatchScalarField
{}
nuSgsWallFunctionFvPatchScalarField::
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField::
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsWallFunctionFvPatchScalarField& nwfpsf
const nuSgsUSpaldingWallFunctionFvPatchScalarField& nwfpsf
)
:
fixedValueFvPatchScalarField(nwfpsf),
......@@ -102,10 +102,10 @@ nuSgsWallFunctionFvPatchScalarField
{}
nuSgsWallFunctionFvPatchScalarField::
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField::
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsWallFunctionFvPatchScalarField& nwfpsf,
const nuSgsUSpaldingWallFunctionFvPatchScalarField& nwfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
......@@ -119,7 +119,7 @@ nuSgsWallFunctionFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void nuSgsWallFunctionFvPatchScalarField::evaluate
void nuSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
(
const Pstream::commsTypes
)
......@@ -183,7 +183,7 @@ void nuSgsWallFunctionFvPatchScalarField::evaluate
}
void nuSgsWallFunctionFvPatchScalarField::write(Ostream& os) const
void nuSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_);
......@@ -199,7 +199,7 @@ void nuSgsWallFunctionFvPatchScalarField::write(Ostream& os) const
makePatchTypeField
(
fvPatchScalarField,
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -24,18 +24,19 @@ License
Class
Foam::incompressible::LESModels::
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField
Description
Spalart Allmaras wall function boundary condition for incompressible flows
Wall function boundary condition for walls, based on velocity, using
Spaldings law to give a continuous nuSgs profile to the wall (y+ = 0)
SourceFiles
nuSgsWallFunctionFvPatchScalarField.C
nuSgsUSpaldingWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef nuSgsWallFunctionFvPatchScalarField_H
#define nuSgsWallFunctionFvPatchScalarField_H
#ifndef nuSgsUSpaldingWallFunctionFvPatchScalarField_H
#define nuSgsUSpaldingWallFunctionFvPatchScalarField_H
#include "fixedValueFvPatchFields.H"
......@@ -49,10 +50,10 @@ namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class nuSgsWallFunctionFvPatchScalarField Declaration
Class nuSgsUSpaldingWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class nuSgsWallFunctionFvPatchScalarField
class nuSgsUSpaldingWallFunctionFvPatchScalarField
:
public fixedValueFvPatchScalarField
{
......@@ -74,20 +75,20 @@ class nuSgsWallFunctionFvPatchScalarField
public:
//- Runtime type information
TypeName("nuSgsWallFunction");
TypeName("nuSgsUSpaldingWallFunction");
// Constructors
//- Construct from patch and internal field
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
......@@ -95,20 +96,20 @@ public:
);
//- Construct by mapping given
// nuSgsWallFunctionFvPatchScalarField
// nuSgsUSpaldingWallFunctionFvPatchScalarField
// onto a new patch
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsWallFunctionFvPatchScalarField&,
const nuSgsUSpaldingWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsWallFunctionFvPatchScalarField&
const nuSgsUSpaldingWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
......@@ -116,14 +117,14 @@ public:
{
return tmp<fvPatchScalarField>
(
new nuSgsWallFunctionFvPatchScalarField(*this)
new nuSgsUSpaldingWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
nuSgsWallFunctionFvPatchScalarField
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsWallFunctionFvPatchScalarField&,
const nuSgsUSpaldingWallFunctionFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
......@@ -135,11 +136,7 @@ public:
{
return tmp<fvPatchScalarField>
(
new nuSgsWallFunctionFvPatchScalarField
(
*this,
iF
)
new nuSgsUSpaldingWallFunctionFvPatchScalarField(*this, iF)
);
}
......
......@@ -293,6 +293,7 @@ bool LaunderGibsonRSTM::read()
if (RASModel::read())
{
Cmu_.readIfPresent(coeffDict());
kappa_.readIfPresent(coeffDict());
Clg1_.readIfPresent(coeffDict());