mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
transportModel: remove IOdictionary base-class so that it is entirely abstract
This commit is contained in:
@ -112,7 +112,13 @@ public:
|
|||||||
|
|
||||||
tmp<volScalarField> nu() const
|
tmp<volScalarField> nu() const
|
||||||
{
|
{
|
||||||
return thermo_->mu()/thermo_->rho();
|
return thermo_->nu();
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
tmp<scalarField> nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return thermo_->nu(patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp<volScalarField> kappa() const
|
tmp<volScalarField> kappa() const
|
||||||
|
|||||||
@ -50,6 +50,18 @@ Foam::threePhaseMixture::threePhaseMixture
|
|||||||
const surfaceScalarField& phi
|
const surfaceScalarField& phi
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
IOdictionary
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"transportProperties",
|
||||||
|
U.time().constant(),
|
||||||
|
U.db(),
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
),
|
||||||
|
|
||||||
transportModel(U, phi),
|
transportModel(U, phi),
|
||||||
|
|
||||||
phase1Name_("phase1"),
|
phase1Name_("phase1"),
|
||||||
|
|||||||
@ -35,6 +35,7 @@ SourceFiles
|
|||||||
#define threePhaseMixture_H
|
#define threePhaseMixture_H
|
||||||
|
|
||||||
#include "incompressible/transportModel/transportModel.H"
|
#include "incompressible/transportModel/transportModel.H"
|
||||||
|
#include "IOdictionary.H"
|
||||||
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
|
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
|
||||||
#include "dimensionedScalar.H"
|
#include "dimensionedScalar.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
@ -50,6 +51,7 @@ namespace Foam
|
|||||||
|
|
||||||
class threePhaseMixture
|
class threePhaseMixture
|
||||||
:
|
:
|
||||||
|
public IOdictionary,
|
||||||
public transportModel
|
public transportModel
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
@ -176,6 +178,12 @@ public:
|
|||||||
return nu_;
|
return nu_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
tmp<scalarField> nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return nu_.boundaryField()[patchi];
|
||||||
|
}
|
||||||
|
|
||||||
//- Return the face-interpolated dynamic laminar viscosity
|
//- Return the face-interpolated dynamic laminar viscosity
|
||||||
tmp<surfaceScalarField> nuf() const;
|
tmp<surfaceScalarField> nuf() const;
|
||||||
|
|
||||||
|
|||||||
@ -371,6 +371,18 @@ Foam::multiphaseSystem::multiphaseSystem
|
|||||||
const surfaceScalarField& phi
|
const surfaceScalarField& phi
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
IOdictionary
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"transportProperties",
|
||||||
|
U.time().constant(),
|
||||||
|
U.db(),
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
),
|
||||||
|
|
||||||
transportModel(U, phi),
|
transportModel(U, phi),
|
||||||
|
|
||||||
phases_(lookup("phases"), phaseModel::iNew(U.mesh())),
|
phases_(lookup("phases"), phaseModel::iNew(U.mesh())),
|
||||||
@ -482,18 +494,54 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::rho() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::multiphaseSystem::rho(const label patchi) const
|
||||||
|
{
|
||||||
|
PtrDictionary<phaseModel>::const_iterator iter = phases_.begin();
|
||||||
|
|
||||||
|
tmp<scalarField> trho = iter().boundaryField()[patchi]*iter().rho().value();
|
||||||
|
|
||||||
|
for (++iter; iter != phases_.end(); ++iter)
|
||||||
|
{
|
||||||
|
trho() += iter().boundaryField()[patchi]*iter().rho().value();
|
||||||
|
}
|
||||||
|
|
||||||
|
return trho;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::nu() const
|
Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::nu() const
|
||||||
{
|
{
|
||||||
PtrDictionary<phaseModel>::const_iterator iter = phases_.begin();
|
PtrDictionary<phaseModel>::const_iterator iter = phases_.begin();
|
||||||
|
|
||||||
tmp<volScalarField> tnu = iter()*iter().nu();
|
tmp<volScalarField> tmu = iter()*(iter().rho()*iter().nu());
|
||||||
|
|
||||||
for (++iter; iter != phases_.end(); ++iter)
|
for (++iter; iter != phases_.end(); ++iter)
|
||||||
{
|
{
|
||||||
tnu() += iter()*iter().nu();
|
tmu() += iter()*(iter().rho()*iter().nu());
|
||||||
}
|
}
|
||||||
|
|
||||||
return tnu;
|
return tmu/rho();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::multiphaseSystem::nu(const label patchi) const
|
||||||
|
{
|
||||||
|
PtrDictionary<phaseModel>::const_iterator iter = phases_.begin();
|
||||||
|
|
||||||
|
tmp<scalarField> tmu =
|
||||||
|
iter().boundaryField()[patchi]
|
||||||
|
*(iter().rho().value()*iter().nu().value());
|
||||||
|
|
||||||
|
for (++iter; iter != phases_.end(); ++iter)
|
||||||
|
{
|
||||||
|
tmu() +=
|
||||||
|
iter().boundaryField()[patchi]
|
||||||
|
*(iter().rho().value()*iter().nu().value());
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmu/rho(patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,7 @@ SourceFiles
|
|||||||
#define multiphaseSystem_H
|
#define multiphaseSystem_H
|
||||||
|
|
||||||
#include "incompressible/transportModel/transportModel.H"
|
#include "incompressible/transportModel/transportModel.H"
|
||||||
|
#include "IOdictionary.H"
|
||||||
#include "phaseModel.H"
|
#include "phaseModel.H"
|
||||||
#include "PtrDictionary.H"
|
#include "PtrDictionary.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
@ -61,6 +62,7 @@ namespace Foam
|
|||||||
|
|
||||||
class multiphaseSystem
|
class multiphaseSystem
|
||||||
:
|
:
|
||||||
|
public IOdictionary,
|
||||||
public transportModel
|
public transportModel
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -255,9 +257,15 @@ public:
|
|||||||
//- Return the mixture density
|
//- Return the mixture density
|
||||||
tmp<volScalarField> rho() const;
|
tmp<volScalarField> rho() const;
|
||||||
|
|
||||||
|
//- Return the mixture density for patch
|
||||||
|
tmp<scalarField> rho(const label patchi) const;
|
||||||
|
|
||||||
//- Return the mixture laminar viscosity
|
//- Return the mixture laminar viscosity
|
||||||
tmp<volScalarField> nu() const;
|
tmp<volScalarField> nu() const;
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
tmp<scalarField> nu(const label patchi) const;
|
||||||
|
|
||||||
//- Return the virtual-mass coefficient for the given phase
|
//- Return the virtual-mass coefficient for the given phase
|
||||||
tmp<volScalarField> Cvm(const phaseModel& phase) const;
|
tmp<volScalarField> Cvm(const phaseModel& phase) const;
|
||||||
|
|
||||||
|
|||||||
@ -65,6 +65,18 @@ Foam::multiphaseMixture::multiphaseMixture
|
|||||||
const surfaceScalarField& phi
|
const surfaceScalarField& phi
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
IOdictionary
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"transportProperties",
|
||||||
|
U.time().constant(),
|
||||||
|
U.db(),
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
),
|
||||||
|
|
||||||
transportModel(U, phi),
|
transportModel(U, phi),
|
||||||
phases_(lookup("phases"), phase::iNew(U, phi)),
|
phases_(lookup("phases"), phase::iNew(U, phi)),
|
||||||
|
|
||||||
@ -116,7 +128,8 @@ Foam::multiphaseMixture::multiphaseMixture
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::rho() const
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::multiphaseMixture::rho() const
|
||||||
{
|
{
|
||||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||||
|
|
||||||
@ -131,7 +144,24 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::rho() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::mu() const
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::multiphaseMixture::rho(const label patchi) const
|
||||||
|
{
|
||||||
|
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||||
|
|
||||||
|
tmp<scalarField> trho = iter().boundaryField()[patchi]*iter().rho().value();
|
||||||
|
|
||||||
|
for (++iter; iter != phases_.end(); ++iter)
|
||||||
|
{
|
||||||
|
trho() += iter().boundaryField()[patchi]*iter().rho().value();
|
||||||
|
}
|
||||||
|
|
||||||
|
return trho;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::multiphaseMixture::mu() const
|
||||||
{
|
{
|
||||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||||
|
|
||||||
@ -146,7 +176,30 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::mu() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseMixture::muf() const
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::multiphaseMixture::mu(const label patchi) const
|
||||||
|
{
|
||||||
|
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||||
|
|
||||||
|
tmp<scalarField> tmu =
|
||||||
|
iter().boundaryField()[patchi]
|
||||||
|
*iter().rho().value()
|
||||||
|
*iter().nu(patchi);
|
||||||
|
|
||||||
|
for (++iter; iter != phases_.end(); ++iter)
|
||||||
|
{
|
||||||
|
tmu() +=
|
||||||
|
iter().boundaryField()[patchi]
|
||||||
|
*iter().rho().value()
|
||||||
|
*iter().nu(patchi);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmu;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::surfaceScalarField>
|
||||||
|
Foam::multiphaseMixture::muf() const
|
||||||
{
|
{
|
||||||
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
PtrDictionary<phase>::const_iterator iter = phases_.begin();
|
||||||
|
|
||||||
@ -163,13 +216,22 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseMixture::muf() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::nu() const
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::multiphaseMixture::nu() const
|
||||||
{
|
{
|
||||||
return mu()/rho();
|
return mu()/rho();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseMixture::nuf() const
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::multiphaseMixture::nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return mu(patchi)/rho(patchi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::surfaceScalarField>
|
||||||
|
Foam::multiphaseMixture::nuf() const
|
||||||
{
|
{
|
||||||
return muf()/fvc::interpolate(rho());
|
return muf()/fvc::interpolate(rho());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,12 +43,12 @@ SourceFiles
|
|||||||
#define multiphaseMixture_H
|
#define multiphaseMixture_H
|
||||||
|
|
||||||
#include "incompressible/transportModel/transportModel.H"
|
#include "incompressible/transportModel/transportModel.H"
|
||||||
|
#include "IOdictionary.H"
|
||||||
#include "phase.H"
|
#include "phase.H"
|
||||||
#include "PtrDictionary.H"
|
#include "PtrDictionary.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
@ -60,6 +60,7 @@ namespace Foam
|
|||||||
|
|
||||||
class multiphaseMixture
|
class multiphaseMixture
|
||||||
:
|
:
|
||||||
|
public IOdictionary,
|
||||||
public transportModel
|
public transportModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -229,15 +230,24 @@ public:
|
|||||||
//- Return the mixture density
|
//- Return the mixture density
|
||||||
tmp<volScalarField> rho() const;
|
tmp<volScalarField> rho() const;
|
||||||
|
|
||||||
|
//- Return the mixture density for patch
|
||||||
|
tmp<scalarField> rho(const label patchi) const;
|
||||||
|
|
||||||
//- Return the dynamic laminar viscosity
|
//- Return the dynamic laminar viscosity
|
||||||
tmp<volScalarField> mu() const;
|
tmp<volScalarField> mu() const;
|
||||||
|
|
||||||
|
//- Return the dynamic laminar viscosity for patch
|
||||||
|
tmp<scalarField> mu(const label patchi) const;
|
||||||
|
|
||||||
//- Return the face-interpolated dynamic laminar viscosity
|
//- Return the face-interpolated dynamic laminar viscosity
|
||||||
tmp<surfaceScalarField> muf() const;
|
tmp<surfaceScalarField> muf() const;
|
||||||
|
|
||||||
//- Return the kinematic laminar viscosity
|
//- Return the kinematic laminar viscosity
|
||||||
tmp<volScalarField> nu() const;
|
tmp<volScalarField> nu() const;
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
tmp<scalarField> nu(const label patchi) const;
|
||||||
|
|
||||||
//- Return the face-interpolated dynamic laminar viscosity
|
//- Return the face-interpolated dynamic laminar viscosity
|
||||||
tmp<surfaceScalarField> nuf() const;
|
tmp<surfaceScalarField> nuf() const;
|
||||||
|
|
||||||
|
|||||||
@ -129,6 +129,12 @@ public:
|
|||||||
return nuModel_->nu();
|
return nuModel_->nu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
tmp<scalarField> nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return nuModel_->nu(patchi);
|
||||||
|
}
|
||||||
|
|
||||||
//- Return const-access to phase1 density
|
//- Return const-access to phase1 density
|
||||||
const dimensionedScalar& rho() const
|
const dimensionedScalar& rho() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -33,7 +33,7 @@ License
|
|||||||
#include "fluidThermo.H"
|
#include "fluidThermo.H"
|
||||||
#include "incompressible/turbulenceModel/turbulenceModel.H"
|
#include "incompressible/turbulenceModel/turbulenceModel.H"
|
||||||
#include "compressible/turbulenceModel/turbulenceModel.H"
|
#include "compressible/turbulenceModel/turbulenceModel.H"
|
||||||
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
#include "incompressible/transportModel/transportModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -94,12 +94,11 @@ Foam::tmp<Foam::volSymmTensorField> Foam::forces::devRhoReff() const
|
|||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
(
|
(
|
||||||
obr_.foundObject<singlePhaseTransportModel>("transportProperties")
|
obr_.foundObject<transportModel>("transportProperties")
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const singlePhaseTransportModel& laminarT =
|
const transportModel& laminarT =
|
||||||
obr_.lookupObject<singlePhaseTransportModel>
|
obr_.lookupObject<transportModel>("transportProperties");
|
||||||
("transportProperties");
|
|
||||||
|
|
||||||
const volVectorField& U = obr_.lookupObject<volVectorField>(UName_);
|
const volVectorField& U = obr_.lookupObject<volVectorField>(UName_);
|
||||||
|
|
||||||
@ -138,12 +137,11 @@ Foam::tmp<Foam::volScalarField> Foam::forces::mu() const
|
|||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
(
|
(
|
||||||
obr_.foundObject<singlePhaseTransportModel>("transportProperties")
|
obr_.foundObject<transportModel>("transportProperties")
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const singlePhaseTransportModel& laminarT =
|
const transportModel& laminarT =
|
||||||
obr_.lookupObject<singlePhaseTransportModel>
|
obr_.lookupObject<transportModel>("transportProperties");
|
||||||
("transportProperties");
|
|
||||||
|
|
||||||
return rho()*laminarT.nu();
|
return rho()*laminarT.nu();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,6 +58,17 @@ Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
|
|||||||
const word& alpha2Name
|
const word& alpha2Name
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
IOdictionary
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"transportProperties",
|
||||||
|
U.time().constant(),
|
||||||
|
U.db(),
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
),
|
||||||
transportModel(U, phi),
|
transportModel(U, phi),
|
||||||
twoPhaseMixture(U.mesh(), *this, alpha1Name, alpha2Name),
|
twoPhaseMixture(U.mesh(), *this, alpha1Name, alpha2Name),
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@ SourceFiles
|
|||||||
#include "incompressible/transportModel/transportModel.H"
|
#include "incompressible/transportModel/transportModel.H"
|
||||||
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
|
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "twoPhaseMixture.H"
|
||||||
|
#include "IOdictionary.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -51,6 +52,7 @@ namespace Foam
|
|||||||
|
|
||||||
class incompressibleTwoPhaseMixture
|
class incompressibleTwoPhaseMixture
|
||||||
:
|
:
|
||||||
|
public IOdictionary,
|
||||||
public transportModel,
|
public transportModel,
|
||||||
public twoPhaseMixture
|
public twoPhaseMixture
|
||||||
{
|
{
|
||||||
@ -133,6 +135,12 @@ public:
|
|||||||
return nu_;
|
return nu_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
virtual tmp<scalarField> nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return nu_.boundaryField()[patchi];
|
||||||
|
}
|
||||||
|
|
||||||
//- Return the face-interpolated kinematic laminar viscosity
|
//- Return the face-interpolated kinematic laminar viscosity
|
||||||
tmp<surfaceScalarField> nuf() const;
|
tmp<surfaceScalarField> nuf() const;
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,17 @@ Foam::singlePhaseTransportModel::singlePhaseTransportModel
|
|||||||
const surfaceScalarField& phi
|
const surfaceScalarField& phi
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
IOdictionary
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"transportProperties",
|
||||||
|
U.time().constant(),
|
||||||
|
U.db(),
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
),
|
||||||
transportModel(U, phi),
|
transportModel(U, phi),
|
||||||
viscosityModelPtr_(viscosityModel::New("nu", *this, U, phi))
|
viscosityModelPtr_(viscosityModel::New("nu", *this, U, phi))
|
||||||
{}
|
{}
|
||||||
@ -49,12 +60,20 @@ Foam::singlePhaseTransportModel::~singlePhaseTransportModel()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::singlePhaseTransportModel::nu() const
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::singlePhaseTransportModel::nu() const
|
||||||
{
|
{
|
||||||
return viscosityModelPtr_->nu();
|
return viscosityModelPtr_->nu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::singlePhaseTransportModel::nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return viscosityModelPtr_->nu(patchi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::singlePhaseTransportModel::correct()
|
void Foam::singlePhaseTransportModel::correct()
|
||||||
{
|
{
|
||||||
viscosityModelPtr_->correct();
|
viscosityModelPtr_->correct();
|
||||||
|
|||||||
@ -39,6 +39,7 @@ SourceFiles
|
|||||||
#define singlePhaseTransportModel_H
|
#define singlePhaseTransportModel_H
|
||||||
|
|
||||||
#include "incompressible/transportModel/transportModel.H"
|
#include "incompressible/transportModel/transportModel.H"
|
||||||
|
#include "IOdictionary.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -54,6 +55,7 @@ class viscosityModel;
|
|||||||
|
|
||||||
class singlePhaseTransportModel
|
class singlePhaseTransportModel
|
||||||
:
|
:
|
||||||
|
public IOdictionary,
|
||||||
public transportModel
|
public transportModel
|
||||||
{
|
{
|
||||||
// Private Data
|
// Private Data
|
||||||
@ -89,10 +91,13 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the laminar viscosity
|
//- Return the laminar viscosity
|
||||||
tmp<volScalarField> nu() const;
|
virtual tmp<volScalarField> nu() const;
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
virtual tmp<scalarField> nu(const label patchi) const;
|
||||||
|
|
||||||
//- Correct the laminar viscosity
|
//- Correct the laminar viscosity
|
||||||
void correct();
|
virtual void correct();
|
||||||
|
|
||||||
//- Read transportProperties dictionary
|
//- Read transportProperties dictionary
|
||||||
virtual bool read();
|
virtual bool read();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,29 +24,22 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "transportModel.H"
|
#include "transportModel.H"
|
||||||
#include "viscosityModel.H"
|
|
||||||
#include "volFields.H"
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(transportModel, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::transportModel::transportModel
|
Foam::transportModel::transportModel
|
||||||
(
|
(
|
||||||
const volVectorField& U,
|
const volVectorField&,
|
||||||
const surfaceScalarField& phi
|
const surfaceScalarField&
|
||||||
)
|
)
|
||||||
:
|
|
||||||
IOdictionary
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"transportProperties",
|
|
||||||
U.time().constant(),
|
|
||||||
U.db(),
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -60,7 +53,7 @@ Foam::transportModel::~transportModel()
|
|||||||
|
|
||||||
bool Foam::transportModel::read()
|
bool Foam::transportModel::read()
|
||||||
{
|
{
|
||||||
return regIOobject::read();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#ifndef transportModel_H
|
#ifndef transportModel_H
|
||||||
#define transportModel_H
|
#define transportModel_H
|
||||||
|
|
||||||
#include "IOdictionary.H"
|
#include "primitiveFieldsFwd.H"
|
||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
#include "surfaceFieldsFwd.H"
|
#include "surfaceFieldsFwd.H"
|
||||||
|
|
||||||
@ -50,8 +50,6 @@ namespace Foam
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class transportModel
|
class transportModel
|
||||||
:
|
|
||||||
public IOdictionary
|
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -64,6 +62,10 @@ class transportModel
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("transportModel");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
@ -71,7 +73,7 @@ public:
|
|||||||
(
|
(
|
||||||
const volVectorField& U,
|
const volVectorField& U,
|
||||||
const surfaceScalarField& phi
|
const surfaceScalarField& phi
|
||||||
);
|
);\
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -83,6 +85,9 @@ public:
|
|||||||
//- Return the laminar viscosity
|
//- Return the laminar viscosity
|
||||||
virtual tmp<volScalarField> nu() const = 0;
|
virtual tmp<volScalarField> nu() const = 0;
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
virtual tmp<scalarField> nu(const label patchi) const = 0;
|
||||||
|
|
||||||
//- Correct the laminar viscosity
|
//- Correct the laminar viscosity
|
||||||
virtual void correct() = 0;
|
virtual void correct() = 0;
|
||||||
|
|
||||||
|
|||||||
@ -107,6 +107,12 @@ public:
|
|||||||
return nu_;
|
return nu_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
tmp<scalarField> nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return nu_.boundaryField()[patchi];
|
||||||
|
}
|
||||||
|
|
||||||
//- Correct the laminar viscosity
|
//- Correct the laminar viscosity
|
||||||
void correct()
|
void correct()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -102,6 +102,12 @@ public:
|
|||||||
return nu_;
|
return nu_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
tmp<scalarField> nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return nu_.boundaryField()[patchi];
|
||||||
|
}
|
||||||
|
|
||||||
//- Correct the laminar viscosity
|
//- Correct the laminar viscosity
|
||||||
void correct()
|
void correct()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -103,6 +103,12 @@ public:
|
|||||||
return nu_;
|
return nu_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
tmp<scalarField> nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return nu_.boundaryField()[patchi];
|
||||||
|
}
|
||||||
|
|
||||||
//- Correct the laminar viscosity
|
//- Correct the laminar viscosity
|
||||||
void correct()
|
void correct()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -92,6 +92,12 @@ public:
|
|||||||
return nu_;
|
return nu_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
tmp<scalarField> nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return nu_.boundaryField()[patchi];
|
||||||
|
}
|
||||||
|
|
||||||
//- Correct the laminar viscosity (not appropriate, viscosity constant)
|
//- Correct the laminar viscosity (not appropriate, viscosity constant)
|
||||||
void correct()
|
void correct()
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -103,6 +103,12 @@ public:
|
|||||||
return nu_;
|
return nu_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
tmp<scalarField> nu(const label patchi) const
|
||||||
|
{
|
||||||
|
return nu_.boundaryField()[patchi];
|
||||||
|
}
|
||||||
|
|
||||||
//- Correct the laminar viscosity
|
//- Correct the laminar viscosity
|
||||||
void correct()
|
void correct()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -154,6 +154,9 @@ public:
|
|||||||
//- Return the laminar viscosity
|
//- Return the laminar viscosity
|
||||||
virtual tmp<volScalarField> nu() const = 0;
|
virtual tmp<volScalarField> nu() const = 0;
|
||||||
|
|
||||||
|
//- Return the laminar viscosity for patch
|
||||||
|
virtual tmp<scalarField> nu(const label patchi) const = 0;
|
||||||
|
|
||||||
//- Correct the laminar viscosity
|
//- Correct the laminar viscosity
|
||||||
virtual void correct() = 0;
|
virtual void correct() = 0;
|
||||||
|
|
||||||
|
|||||||
@ -212,9 +212,14 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
|
|||||||
const tmp<volScalarField> tk = turbModel.k();
|
const tmp<volScalarField> tk = turbModel.k();
|
||||||
const volScalarField& k = tk();
|
const volScalarField& k = tk();
|
||||||
|
|
||||||
|
const IOdictionary& transportProperties =
|
||||||
|
db().lookupObject<IOdictionary>("transportProperties");
|
||||||
|
|
||||||
// Molecular Prandtl number
|
// Molecular Prandtl number
|
||||||
const scalar
|
const scalar Pr
|
||||||
Pr(dimensionedScalar(turbModel.transport().lookup("Pr")).value());
|
(
|
||||||
|
dimensionedScalar(transportProperties.lookup("Pr")).value()
|
||||||
|
);
|
||||||
|
|
||||||
// Populate boundary values
|
// Populate boundary values
|
||||||
scalarField& alphatw = *this;
|
scalarField& alphatw = *this;
|
||||||
|
|||||||
@ -192,9 +192,9 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
|||||||
patch().lookupPatchField<volScalarField, scalar>(alphaEffName_);
|
patch().lookupPatchField<volScalarField, scalar>(alphaEffName_);
|
||||||
|
|
||||||
// retrieve (constant) specific heat capacity from transport dictionary
|
// retrieve (constant) specific heat capacity from transport dictionary
|
||||||
const turbulenceModel& turbulence =
|
const IOdictionary& transportProperties =
|
||||||
db().lookupObject<turbulenceModel>("turbulenceModel");
|
db().lookupObject<IOdictionary>("transportProperties");
|
||||||
const scalar Cp0(readScalar(turbulence.transport().lookup("Cp0")));
|
const scalar Cp0(readScalar(transportProperties.lookup("Cp0")));
|
||||||
|
|
||||||
switch (heatSource_)
|
switch (heatSource_)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user