momentumTransportModels::laminar: Improved inheritance of member functions
This commit is contained in:
@ -37,7 +37,7 @@ namespace laminarModels
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
Foam::PtrList<Foam::dimensionedScalar>
|
||||
PtrList<dimensionedScalar>
|
||||
Maxwell<BasicMomentumTransportModel>::readModeCoefficients
|
||||
(
|
||||
const word& name,
|
||||
@ -135,15 +135,7 @@ Maxwell<BasicMomentumTransportModel>::Maxwell
|
||||
|
||||
nModes_(modeCoefficients_.size() ? modeCoefficients_.size() : 1),
|
||||
|
||||
nuM_
|
||||
(
|
||||
dimensioned<scalar>
|
||||
(
|
||||
"nuM",
|
||||
dimViscosity,
|
||||
this->coeffDict_.lookup("nuM")
|
||||
)
|
||||
),
|
||||
nuM_("nuM", dimViscosity, this->coeffDict_.lookup("nuM")),
|
||||
|
||||
lambdas_(readModeCoefficients("lambda", dimTime)),
|
||||
|
||||
@ -238,7 +230,7 @@ bool Maxwell<BasicMomentumTransportModel>::read()
|
||||
this->coeffDict().lookup("modes") >> modeCoefficients_;
|
||||
}
|
||||
|
||||
nuM_.readIfPresent(this->coeffDict());
|
||||
nuM_.read(this->coeffDict());
|
||||
|
||||
lambdas_ = readModeCoefficients("lambda", dimTime);
|
||||
|
||||
@ -252,16 +244,35 @@ bool Maxwell<BasicMomentumTransportModel>::read()
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<Foam::volSymmTensorField>
|
||||
Maxwell<BasicMomentumTransportModel>::sigma() const
|
||||
tmp<volScalarField> Maxwell<BasicMomentumTransportModel>::nuEff() const
|
||||
{
|
||||
return volScalarField::New
|
||||
(
|
||||
IOobject::groupName("nuEff", this->alphaRhoPhi_.group()),
|
||||
this->nu()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<scalarField> Maxwell<BasicMomentumTransportModel>::nuEff
|
||||
(
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return this->nu(patchi);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volSymmTensorField> Maxwell<BasicMomentumTransportModel>::sigma() const
|
||||
{
|
||||
return sigma_;
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<Foam::volSymmTensorField>
|
||||
Maxwell<BasicMomentumTransportModel>::devTau() const
|
||||
tmp<volSymmTensorField> Maxwell<BasicMomentumTransportModel>::devTau() const
|
||||
{
|
||||
return volSymmTensorField::New
|
||||
(
|
||||
@ -274,8 +285,7 @@ Maxwell<BasicMomentumTransportModel>::devTau() const
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<Foam::fvVectorMatrix>
|
||||
Maxwell<BasicMomentumTransportModel>::divDevTau
|
||||
tmp<fvVectorMatrix> Maxwell<BasicMomentumTransportModel>::divDevTau
|
||||
(
|
||||
volVectorField& U
|
||||
) const
|
||||
@ -294,7 +304,7 @@ Maxwell<BasicMomentumTransportModel>::divDevTau
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<Foam::fvVectorMatrix>
|
||||
tmp<fvVectorMatrix>
|
||||
Maxwell<BasicMomentumTransportModel>::divDevTau
|
||||
(
|
||||
const volScalarField& rho,
|
||||
|
||||
@ -160,6 +160,12 @@ public:
|
||||
//- Read model coefficients if they have changed
|
||||
virtual bool read();
|
||||
|
||||
//- Return the effective viscosity, i.e. the laminar viscosity
|
||||
virtual tmp<volScalarField> nuEff() const;
|
||||
|
||||
//- Return the effective viscosity on patch
|
||||
virtual tmp<scalarField> nuEff(const label patchi) const;
|
||||
|
||||
//- Return the stress tensor [m^2/s^2]
|
||||
virtual tmp<volSymmTensorField> sigma() const;
|
||||
|
||||
|
||||
@ -66,8 +66,7 @@ Stokes<BasicMomentumTransportModel>::Stokes
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
const dictionary&
|
||||
Stokes<BasicMomentumTransportModel>::coeffDict() const
|
||||
const dictionary& Stokes<BasicMomentumTransportModel>::coeffDict() const
|
||||
{
|
||||
return dictionary::null;
|
||||
}
|
||||
@ -81,35 +80,7 @@ bool Stokes<BasicMomentumTransportModel>::read()
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volScalarField>
|
||||
Stokes<BasicMomentumTransportModel>::nut() const
|
||||
{
|
||||
return volScalarField::New
|
||||
(
|
||||
IOobject::groupName("nut", this->alphaRhoPhi_.group()),
|
||||
this->mesh_,
|
||||
dimensionedScalar(dimViscosity, 0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<scalarField>
|
||||
Stokes<BasicMomentumTransportModel>::nut
|
||||
(
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return tmp<scalarField>
|
||||
(
|
||||
new scalarField(this->mesh_.boundary()[patchi].size(), 0.0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volScalarField>
|
||||
Stokes<BasicMomentumTransportModel>::nuEff() const
|
||||
tmp<volScalarField> Stokes<BasicMomentumTransportModel>::nuEff() const
|
||||
{
|
||||
return volScalarField::New
|
||||
(
|
||||
@ -120,8 +91,7 @@ Stokes<BasicMomentumTransportModel>::nuEff() const
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<scalarField>
|
||||
Stokes<BasicMomentumTransportModel>::nuEff
|
||||
tmp<scalarField> Stokes<BasicMomentumTransportModel>::nuEff
|
||||
(
|
||||
const label patchi
|
||||
) const
|
||||
@ -130,45 +100,6 @@ Stokes<BasicMomentumTransportModel>::nuEff
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volScalarField>
|
||||
Stokes<BasicMomentumTransportModel>::k() const
|
||||
{
|
||||
return volScalarField::New
|
||||
(
|
||||
IOobject::groupName("k", this->alphaRhoPhi_.group()),
|
||||
this->mesh_,
|
||||
dimensionedScalar(sqr(this->U_.dimensions()), 0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volScalarField>
|
||||
Stokes<BasicMomentumTransportModel>::epsilon() const
|
||||
{
|
||||
return volScalarField::New
|
||||
(
|
||||
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
|
||||
this->mesh_,
|
||||
dimensionedScalar(sqr(this->U_.dimensions())/dimTime, 0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volSymmTensorField>
|
||||
Stokes<BasicMomentumTransportModel>::sigma() const
|
||||
{
|
||||
return volSymmTensorField::New
|
||||
(
|
||||
IOobject::groupName("R", this->alphaRhoPhi_.group()),
|
||||
this->mesh_,
|
||||
dimensionedSymmTensor(sqr(this->U_.dimensions()), Zero)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
void Stokes<BasicMomentumTransportModel>::correct()
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::laminarModels::Stokes
|
||||
|
||||
Description
|
||||
Turbulence model for Stokes flow.
|
||||
Momentum transport model for Stokes flow.
|
||||
|
||||
SourceFiles
|
||||
Stokes.C
|
||||
@ -107,28 +107,12 @@ public:
|
||||
//- Read momentumTransport dictionary
|
||||
virtual bool read();
|
||||
|
||||
//- Return the turbulence viscosity, i.e. 0 for Stokes flow
|
||||
virtual tmp<volScalarField> nut() const;
|
||||
|
||||
//- Return the turbulence viscosity on patch
|
||||
virtual tmp<scalarField> nut(const label patchi) const;
|
||||
|
||||
//- Return the effective viscosity, i.e. the Stokes viscosity
|
||||
virtual tmp<volScalarField> nuEff() const;
|
||||
|
||||
//- Return the effective viscosity on patch
|
||||
virtual tmp<scalarField> nuEff(const label patchi) const;
|
||||
|
||||
//- Return the turbulence kinetic energy, i.e. 0 for Stokes flow
|
||||
virtual tmp<volScalarField> k() const;
|
||||
|
||||
//- Return the turbulence kinetic energy dissipation rate,
|
||||
// i.e. 0 for Stokes flow
|
||||
virtual tmp<volScalarField> epsilon() const;
|
||||
|
||||
//- Return the stress tensor [m^2/s^2], i.e. 0 for Stokes flow
|
||||
virtual tmp<volSymmTensorField> sigma() const;
|
||||
|
||||
//- Correct the Stokes viscosity
|
||||
virtual void correct();
|
||||
};
|
||||
|
||||
@ -73,7 +73,11 @@ generalizedNewtonian<BasicMomentumTransportModel>::generalizedNewtonian
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("generalizedNewtonian:nu", alphaRhoPhi.group()),
|
||||
IOobject::groupName
|
||||
(
|
||||
IOobject::modelName("nu", typeName),
|
||||
alphaRhoPhi.group()
|
||||
),
|
||||
this->runTime_.timeName(),
|
||||
this->mesh_,
|
||||
IOobject::NO_READ,
|
||||
@ -87,7 +91,7 @@ generalizedNewtonian<BasicMomentumTransportModel>::generalizedNewtonian
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
tmp<volScalarField>
|
||||
generalizedNewtonian<BasicMomentumTransportModel>::strainRate() const
|
||||
{
|
||||
return sqrt(2.0)*mag(symm(fvc::grad(this->U())));
|
||||
@ -105,33 +109,6 @@ bool generalizedNewtonian<BasicMomentumTransportModel>::read()
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volScalarField>
|
||||
generalizedNewtonian<BasicMomentumTransportModel>::nut() const
|
||||
{
|
||||
return volScalarField::New
|
||||
(
|
||||
IOobject::groupName("nut", this->alphaRhoPhi_.group()),
|
||||
this->mesh_,
|
||||
dimensionedScalar(dimViscosity, 0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<scalarField>
|
||||
generalizedNewtonian<BasicMomentumTransportModel>::nut
|
||||
(
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return tmp<scalarField>
|
||||
(
|
||||
new scalarField(this->mesh_.boundary()[patchi].size(), 0.0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volScalarField>
|
||||
generalizedNewtonian<BasicMomentumTransportModel>::nuEff() const
|
||||
@ -155,45 +132,6 @@ generalizedNewtonian<BasicMomentumTransportModel>::nuEff
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volScalarField>
|
||||
generalizedNewtonian<BasicMomentumTransportModel>::k() const
|
||||
{
|
||||
return volScalarField::New
|
||||
(
|
||||
IOobject::groupName("k", this->alphaRhoPhi_.group()),
|
||||
this->mesh_,
|
||||
dimensionedScalar(sqr(this->U_.dimensions()), 0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volScalarField>
|
||||
generalizedNewtonian<BasicMomentumTransportModel>::epsilon() const
|
||||
{
|
||||
return volScalarField::New
|
||||
(
|
||||
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
|
||||
this->mesh_,
|
||||
dimensionedScalar(sqr(this->U_.dimensions())/dimTime, 0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
tmp<volSymmTensorField>
|
||||
generalizedNewtonian<BasicMomentumTransportModel>::sigma() const
|
||||
{
|
||||
return volSymmTensorField::New
|
||||
(
|
||||
IOobject::groupName("R", this->alphaRhoPhi_.group()),
|
||||
this->mesh_,
|
||||
dimensionedSymmTensor(sqr(this->U_.dimensions()), Zero)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
void generalizedNewtonian<BasicMomentumTransportModel>::correct()
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::laminarModels::generalizedNewtonian
|
||||
|
||||
Description
|
||||
Turbulence model for shear-dependent Non-Newtonian flow.
|
||||
Momentum transport model for shear-dependent Non-Newtonian flow.
|
||||
|
||||
SourceFiles
|
||||
generalizedNewtonian.C
|
||||
@ -121,13 +121,6 @@ public:
|
||||
//- Read momentumTransport dictionary
|
||||
virtual bool read();
|
||||
|
||||
//- Return the turbulence viscosity,
|
||||
// i.e. 0 for generalized Newtonian flow
|
||||
virtual tmp<volScalarField> nut() const;
|
||||
|
||||
//- Return the turbulence viscosity on patch
|
||||
virtual tmp<scalarField> nut(const label patchi) const;
|
||||
|
||||
//- Return the effective viscosity
|
||||
// i.e. the generalizedNewtonian viscosity
|
||||
virtual tmp<volScalarField> nuEff() const;
|
||||
@ -135,18 +128,6 @@ public:
|
||||
//- Return the effective viscosity on patch
|
||||
virtual tmp<scalarField> nuEff(const label patchi) const;
|
||||
|
||||
//- Return the turbulence kinetic energy
|
||||
// i.e. 0 for generalizedNewtonian flow
|
||||
virtual tmp<volScalarField> k() const;
|
||||
|
||||
//- Return the turbulence kinetic energy dissipation rate,
|
||||
// i.e. 0 for generalizedNewtonian flow
|
||||
virtual tmp<volScalarField> epsilon() const;
|
||||
|
||||
//- Return the stress tensor [m^2/s^2]
|
||||
// i.e. 0 for generalizedNewtonian flow
|
||||
virtual tmp<volSymmTensorField> sigma() const;
|
||||
|
||||
//- Correct the generalizedNewtonian viscosity
|
||||
virtual void correct();
|
||||
};
|
||||
|
||||
@ -205,29 +205,6 @@ Foam::laminarModel<BasicMomentumTransportModel>::nut
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::laminarModel<BasicMomentumTransportModel>::nuEff() const
|
||||
{
|
||||
return volScalarField::New
|
||||
(
|
||||
IOobject::groupName("nuEff", this->alphaRhoPhi_.group()),
|
||||
this->nu()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::laminarModel<BasicMomentumTransportModel>::nuEff
|
||||
(
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return this->nu(patchi);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicMomentumTransportModel>
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::laminarModel<BasicMomentumTransportModel>::k() const
|
||||
@ -260,7 +237,7 @@ Foam::laminarModel<BasicMomentumTransportModel>::sigma() const
|
||||
{
|
||||
return volSymmTensorField::New
|
||||
(
|
||||
IOobject::groupName("R", this->alphaRhoPhi_.group()),
|
||||
IOobject::groupName("sigma", this->alphaRhoPhi_.group()),
|
||||
this->mesh_,
|
||||
dimensionedSymmTensor(sqr(this->U_.dimensions()), Zero)
|
||||
);
|
||||
|
||||
@ -144,39 +144,36 @@ public:
|
||||
//- Read model coefficients if they have changed
|
||||
virtual bool read();
|
||||
|
||||
//- Const access to the coefficients dictionary
|
||||
virtual const dictionary& coeffDict() const
|
||||
{
|
||||
return coeffDict_;
|
||||
}
|
||||
|
||||
// Access
|
||||
//- Return the turbulence viscosity, i.e. 0 for laminar flow
|
||||
virtual tmp<volScalarField> nut() const;
|
||||
|
||||
//- Const access to the coefficients dictionary
|
||||
virtual const dictionary& coeffDict() const
|
||||
{
|
||||
return coeffDict_;
|
||||
}
|
||||
//- Return the turbulence viscosity on patch
|
||||
virtual tmp<scalarField> nut(const label patchi) const;
|
||||
|
||||
//- Return the turbulence viscosity, i.e. 0 for laminar flow
|
||||
virtual tmp<volScalarField> nut() const;
|
||||
//- Return the effective viscosity, i.e. the laminar viscosity
|
||||
virtual tmp<volScalarField> nuEff() const = 0;
|
||||
|
||||
//- Return the turbulence viscosity on patch
|
||||
virtual tmp<scalarField> nut(const label patchi) const;
|
||||
//- Return the effective viscosity on patch
|
||||
virtual tmp<scalarField> nuEff(const label patchi) const = 0;
|
||||
|
||||
//- Return the effective viscosity, i.e. the laminar viscosity
|
||||
virtual tmp<volScalarField> nuEff() const;
|
||||
//- Return the turbulence kinetic energy, i.e. 0 for laminar flow
|
||||
virtual tmp<volScalarField> k() const;
|
||||
|
||||
//- Return the effective viscosity on patch
|
||||
virtual tmp<scalarField> nuEff(const label patchi) const;
|
||||
//- Return the turbulence kinetic energy dissipation rate,
|
||||
// i.e. 0 for laminar flow
|
||||
virtual tmp<volScalarField> epsilon() const;
|
||||
|
||||
//- Return the turbulence kinetic energy, i.e. 0 for laminar flow
|
||||
virtual tmp<volScalarField> k() const;
|
||||
//- Return the stress tensor [m^2/s^2], i.e. 0 for laminar flow
|
||||
virtual tmp<volSymmTensorField> sigma() const;
|
||||
|
||||
//- Return the turbulence kinetic energy dissipation rate,
|
||||
// i.e. 0 for laminar flow
|
||||
virtual tmp<volScalarField> epsilon() const;
|
||||
|
||||
//- Return the stress tensor [m^2/s^2], i.e. 0 for laminar flow
|
||||
virtual tmp<volSymmTensorField> sigma() const;
|
||||
|
||||
//- Correct the laminar transport
|
||||
virtual void correct();
|
||||
//- Correct the laminar transport
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
Reference in New Issue
Block a user