mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
@ -143,10 +143,7 @@ Foam::ThermalDiffusivity<BasicTurbulenceModel>::alphat
|
|||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<scalarField>
|
return tmp<scalarField>::New(this->mesh_.boundary()[patchi].size(), Zero);
|
||||||
(
|
|
||||||
new scalarField(this->mesh_.boundary()[patchi].size(), Zero)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -168,16 +168,10 @@ tmp<volScalarField> DESModel<BasicTurbulenceModel>::Ssigma
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<volScalarField> DESModel<BasicTurbulenceModel>::fd() const
|
tmp<volScalarField> DESModel<BasicTurbulenceModel>::fd() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>::New
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
"fd",
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
"fd",
|
|
||||||
this->mesh_.time().timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
dimensionedScalar(dimless, Zero)
|
dimensionedScalar(dimless, Zero)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -53,21 +53,12 @@ void Foam::LESModels::IDDESDelta::calcDelta()
|
|||||||
// Wall-normal vectors
|
// Wall-normal vectors
|
||||||
const volVectorField& n = wallDist::New(mesh).n();
|
const volVectorField& n = wallDist::New(mesh).n();
|
||||||
|
|
||||||
tmp<volScalarField> tfaceToFacenMax
|
auto tfaceToFacenMax = volScalarField::New
|
||||||
(
|
(
|
||||||
new volScalarField
|
"faceToFaceMax",
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject
|
mesh,
|
||||||
(
|
dimensionedScalar(dimLength, Zero)
|
||||||
"faceToFaceMax",
|
|
||||||
mesh.time().timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar(dimLength, Zero)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
scalarField& faceToFacenMax = tfaceToFacenMax.ref().primitiveFieldRef();
|
scalarField& faceToFacenMax = tfaceToFacenMax.ref().primitiveFieldRef();
|
||||||
|
|||||||
@ -182,19 +182,12 @@ Foam::tmp<Foam::volSymmTensorField> Foam::anisotropicFilter::operator()
|
|||||||
{
|
{
|
||||||
correctBoundaryConditions(unFilteredField);
|
correctBoundaryConditions(unFilteredField);
|
||||||
|
|
||||||
tmp<volSymmTensorField> tmpFilteredField
|
auto tmpFilteredField = volSymmTensorField::New
|
||||||
(
|
(
|
||||||
new volSymmTensorField
|
"anisotropicFilteredSymmTensorField",
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject
|
mesh(),
|
||||||
(
|
unFilteredField().dimensions()
|
||||||
"anisotropicFilteredSymmTensorField",
|
|
||||||
mesh().time().timeName(),
|
|
||||||
mesh()
|
|
||||||
),
|
|
||||||
mesh(),
|
|
||||||
unFilteredField().dimensions()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
for (direction d=0; d<symmTensor::nComponents; d++)
|
for (direction d=0; d<symmTensor::nComponents; d++)
|
||||||
@ -218,19 +211,12 @@ Foam::tmp<Foam::volTensorField> Foam::anisotropicFilter::operator()
|
|||||||
{
|
{
|
||||||
correctBoundaryConditions(unFilteredField);
|
correctBoundaryConditions(unFilteredField);
|
||||||
|
|
||||||
tmp<volTensorField> tmpFilteredField
|
auto tmpFilteredField = volTensorField::New
|
||||||
(
|
(
|
||||||
new volTensorField
|
"anisotropicFilteredTensorField",
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject
|
mesh(),
|
||||||
(
|
unFilteredField().dimensions()
|
||||||
"anisotropicFilteredTensorField",
|
|
||||||
mesh().time().timeName(),
|
|
||||||
mesh()
|
|
||||||
),
|
|
||||||
mesh(),
|
|
||||||
unFilteredField().dimensions()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
for (direction d=0; d<tensor::nComponents; d++)
|
for (direction d=0; d<tensor::nComponents; d++)
|
||||||
|
|||||||
@ -138,14 +138,10 @@ void dynamicKEqn<BasicTurbulenceModel>::correctNut()
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<fvScalarMatrix> dynamicKEqn<BasicTurbulenceModel>::kSource() const
|
tmp<fvScalarMatrix> dynamicKEqn<BasicTurbulenceModel>::kSource() const
|
||||||
{
|
{
|
||||||
return tmp<fvScalarMatrix>
|
return tmp<fvScalarMatrix>::New
|
||||||
(
|
(
|
||||||
new fvScalarMatrix
|
k_,
|
||||||
(
|
dimVolume*this->rho_.dimensions()*k_.dimensions()/dimTime
|
||||||
k_,
|
|
||||||
dimVolume*this->rho_.dimensions()*k_.dimensions()
|
|
||||||
/dimTime
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -52,14 +52,10 @@ void kEqn<BasicTurbulenceModel>::correctNut()
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<fvScalarMatrix> kEqn<BasicTurbulenceModel>::kSource() const
|
tmp<fvScalarMatrix> kEqn<BasicTurbulenceModel>::kSource() const
|
||||||
{
|
{
|
||||||
return tmp<fvScalarMatrix>
|
return tmp<fvScalarMatrix>::New
|
||||||
(
|
(
|
||||||
new fvScalarMatrix
|
k_,
|
||||||
(
|
dimVolume*this->rho_.dimensions()*k_.dimensions()/dimTime
|
||||||
k_,
|
|
||||||
dimVolume*this->rho_.dimensions()*k_.dimensions()
|
|
||||||
/dimTime
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -69,14 +69,10 @@ void LaunderSharmaKE<BasicTurbulenceModel>::correctNut()
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<fvScalarMatrix> LaunderSharmaKE<BasicTurbulenceModel>::kSource() const
|
tmp<fvScalarMatrix> LaunderSharmaKE<BasicTurbulenceModel>::kSource() const
|
||||||
{
|
{
|
||||||
return tmp<fvScalarMatrix>
|
return tmp<fvScalarMatrix>::New
|
||||||
(
|
(
|
||||||
new fvScalarMatrix
|
k_,
|
||||||
(
|
dimVolume*this->rho_.dimensions()*k_.dimensions()/dimTime
|
||||||
k_,
|
|
||||||
dimVolume*this->rho_.dimensions()*k_.dimensions()
|
|
||||||
/dimTime
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,14 +80,10 @@ tmp<fvScalarMatrix> LaunderSharmaKE<BasicTurbulenceModel>::kSource() const
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<fvScalarMatrix> LaunderSharmaKE<BasicTurbulenceModel>::epsilonSource() const
|
tmp<fvScalarMatrix> LaunderSharmaKE<BasicTurbulenceModel>::epsilonSource() const
|
||||||
{
|
{
|
||||||
return tmp<fvScalarMatrix>
|
return tmp<fvScalarMatrix>::New
|
||||||
(
|
(
|
||||||
new fvScalarMatrix
|
epsilon_,
|
||||||
(
|
dimVolume*this->rho_.dimensions()*epsilon_.dimensions()/dimTime
|
||||||
epsilon_,
|
|
||||||
dimVolume*this->rho_.dimensions()*epsilon_.dimensions()
|
|
||||||
/dimTime
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -193,14 +193,10 @@ Foam::RASModel<BasicTurbulenceModel>::epsilon() const
|
|||||||
{
|
{
|
||||||
const scalar Cmu = 0.09;
|
const scalar Cmu = 0.09;
|
||||||
|
|
||||||
return tmp<volScalarField>::New
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
|
|
||||||
this->mesh_.time().timeName(),
|
|
||||||
this->mesh_
|
|
||||||
),
|
|
||||||
Cmu*this->k()*this->omega()
|
Cmu*this->k()*this->omega()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -213,14 +209,10 @@ Foam::RASModel<BasicTurbulenceModel>::omega() const
|
|||||||
const scalar betaStar = 0.09;
|
const scalar betaStar = 0.09;
|
||||||
const dimensionedScalar k0(sqr(dimLength/dimTime), SMALL);
|
const dimensionedScalar k0(sqr(dimLength/dimTime), SMALL);
|
||||||
|
|
||||||
return tmp<volScalarField>::New
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
|
|
||||||
this->mesh_.time().timeName(),
|
|
||||||
this->mesh_
|
|
||||||
),
|
|
||||||
this->epsilon()/(betaStar*(this->k() + k0))
|
this->epsilon()/(betaStar*(this->k() + k0))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,14 +53,10 @@ void RNGkEpsilon<BasicTurbulenceModel>::correctNut()
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<fvScalarMatrix> RNGkEpsilon<BasicTurbulenceModel>::kSource() const
|
tmp<fvScalarMatrix> RNGkEpsilon<BasicTurbulenceModel>::kSource() const
|
||||||
{
|
{
|
||||||
return tmp<fvScalarMatrix>
|
return tmp<fvScalarMatrix>::New
|
||||||
(
|
(
|
||||||
new fvScalarMatrix
|
k_,
|
||||||
(
|
dimVolume*this->rho_.dimensions()*k_.dimensions()/dimTime
|
||||||
k_,
|
|
||||||
dimVolume*this->rho_.dimensions()*k_.dimensions()
|
|
||||||
/dimTime
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,14 +64,10 @@ tmp<fvScalarMatrix> RNGkEpsilon<BasicTurbulenceModel>::kSource() const
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<fvScalarMatrix> RNGkEpsilon<BasicTurbulenceModel>::epsilonSource() const
|
tmp<fvScalarMatrix> RNGkEpsilon<BasicTurbulenceModel>::epsilonSource() const
|
||||||
{
|
{
|
||||||
return tmp<fvScalarMatrix>
|
return tmp<fvScalarMatrix>::New
|
||||||
(
|
(
|
||||||
new fvScalarMatrix
|
epsilon_,
|
||||||
(
|
dimVolume*this->rho_.dimensions()*epsilon_.dimensions()/dimTime
|
||||||
epsilon_,
|
|
||||||
dimVolume*this->rho_.dimensions()*epsilon_.dimensions()
|
|
||||||
/dimTime
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,14 +53,10 @@ void kEpsilon<BasicTurbulenceModel>::correctNut()
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<fvScalarMatrix> kEpsilon<BasicTurbulenceModel>::kSource() const
|
tmp<fvScalarMatrix> kEpsilon<BasicTurbulenceModel>::kSource() const
|
||||||
{
|
{
|
||||||
return tmp<fvScalarMatrix>
|
return tmp<fvScalarMatrix>::New
|
||||||
(
|
(
|
||||||
new fvScalarMatrix
|
k_,
|
||||||
(
|
dimVolume*this->rho_.dimensions()*k_.dimensions()/dimTime
|
||||||
k_,
|
|
||||||
dimVolume*this->rho_.dimensions()*k_.dimensions()
|
|
||||||
/dimTime
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,14 +64,10 @@ tmp<fvScalarMatrix> kEpsilon<BasicTurbulenceModel>::kSource() const
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<fvScalarMatrix> kEpsilon<BasicTurbulenceModel>::epsilonSource() const
|
tmp<fvScalarMatrix> kEpsilon<BasicTurbulenceModel>::epsilonSource() const
|
||||||
{
|
{
|
||||||
return tmp<fvScalarMatrix>
|
return tmp<fvScalarMatrix>::New
|
||||||
(
|
(
|
||||||
new fvScalarMatrix
|
epsilon_,
|
||||||
(
|
dimVolume*this->rho_.dimensions()*epsilon_.dimensions()/dimTime
|
||||||
epsilon_,
|
|
||||||
dimVolume*this->rho_.dimensions()*epsilon_.dimensions()
|
|
||||||
/dimTime
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -95,11 +95,11 @@ tmp<volScalarField::Internal> kOmegaSSTLM<BasicTurbulenceModel>::Fthetat
|
|||||||
const volScalarField::Internal ReOmega(sqr(y)*omega/nu);
|
const volScalarField::Internal ReOmega(sqr(y)*omega/nu);
|
||||||
const volScalarField::Internal Fwake(exp(-sqr(ReOmega/1e5)));
|
const volScalarField::Internal Fwake(exp(-sqr(ReOmega/1e5)));
|
||||||
|
|
||||||
return tmp<volScalarField::Internal>
|
return volScalarField::Internal::New
|
||||||
(
|
(
|
||||||
new volScalarField::Internal
|
IOobject::groupName("Fthetat", this->alphaRhoPhi_.group()),
|
||||||
|
IOobject::NO_REGISTER,
|
||||||
(
|
(
|
||||||
IOobject::groupName("Fthetat", this->alphaRhoPhi_.group()),
|
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
max
|
max
|
||||||
@ -118,21 +118,14 @@ template<class BasicTurbulenceModel>
|
|||||||
tmp<volScalarField::Internal>
|
tmp<volScalarField::Internal>
|
||||||
kOmegaSSTLM<BasicTurbulenceModel>::ReThetac() const
|
kOmegaSSTLM<BasicTurbulenceModel>::ReThetac() const
|
||||||
{
|
{
|
||||||
tmp<volScalarField::Internal> tReThetac
|
auto tReThetac = volScalarField::Internal::New
|
||||||
(
|
(
|
||||||
new volScalarField::Internal
|
IOobject::groupName("ReThetac", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject
|
this->mesh_,
|
||||||
(
|
dimless
|
||||||
IOobject::groupName("ReThetac", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_
|
|
||||||
),
|
|
||||||
this->mesh_,
|
|
||||||
dimless
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
volScalarField::Internal& ReThetac = tReThetac.ref();
|
auto& ReThetac = tReThetac.ref();
|
||||||
|
|
||||||
forAll(ReThetac, celli)
|
forAll(ReThetac, celli)
|
||||||
{
|
{
|
||||||
@ -161,21 +154,14 @@ tmp<volScalarField::Internal> kOmegaSSTLM<BasicTurbulenceModel>::Flength
|
|||||||
const volScalarField::Internal& nu
|
const volScalarField::Internal& nu
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
tmp<volScalarField::Internal> tFlength
|
auto tFlength = volScalarField::Internal::New
|
||||||
(
|
(
|
||||||
new volScalarField::Internal
|
IOobject::groupName("Flength", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject
|
this->mesh_,
|
||||||
(
|
dimless
|
||||||
IOobject::groupName("Flength", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_
|
|
||||||
),
|
|
||||||
this->mesh_,
|
|
||||||
dimless
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
volScalarField::Internal& Flength = tFlength.ref();
|
auto& Flength = tFlength.ref();
|
||||||
|
|
||||||
const volScalarField::Internal& omega = this->omega_();
|
const volScalarField::Internal& omega = this->omega_();
|
||||||
const volScalarField::Internal& y = this->y_();
|
const volScalarField::Internal& y = this->y_();
|
||||||
@ -226,21 +212,14 @@ tmp<volScalarField::Internal> kOmegaSSTLM<BasicTurbulenceModel>::ReThetat0
|
|||||||
const volScalarField::Internal& nu
|
const volScalarField::Internal& nu
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
tmp<volScalarField::Internal> tReThetat0
|
auto tReThetat0 = volScalarField::Internal::New
|
||||||
(
|
(
|
||||||
new volScalarField::Internal
|
IOobject::groupName("ReThetat0", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject
|
this->mesh_,
|
||||||
(
|
dimless
|
||||||
IOobject::groupName("ReThetat0", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_
|
|
||||||
),
|
|
||||||
this->mesh_,
|
|
||||||
dimless
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
volScalarField::Internal& ReThetat0 = tReThetat0.ref();
|
auto& ReThetat0 = tReThetat0.ref();
|
||||||
|
|
||||||
const volScalarField& k = this->k_;
|
const volScalarField& k = this->k_;
|
||||||
|
|
||||||
@ -349,13 +328,11 @@ tmp<volScalarField::Internal> kOmegaSSTLM<BasicTurbulenceModel>::Fonset
|
|||||||
|
|
||||||
const volScalarField::Internal Fonset3(max(1 - pow3(RT/2.5), scalar(0)));
|
const volScalarField::Internal Fonset3(max(1 - pow3(RT/2.5), scalar(0)));
|
||||||
|
|
||||||
return tmp<volScalarField::Internal>
|
return volScalarField::Internal::New
|
||||||
(
|
(
|
||||||
new volScalarField::Internal
|
IOobject::groupName("Fonset", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("Fonset", this->alphaRhoPhi_.group()),
|
max(Fonset2 - Fonset3, scalar(0))
|
||||||
max(Fonset2 - Fonset3, scalar(0))
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,7 +436,8 @@ kOmegaSSTLM<BasicTurbulenceModel>::kOmegaSSTLM
|
|||||||
this->runTime_.timeName(),
|
this->runTime_.timeName(),
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE,
|
||||||
|
IOobject::REGISTER
|
||||||
),
|
),
|
||||||
this->mesh_
|
this->mesh_
|
||||||
),
|
),
|
||||||
@ -472,7 +450,8 @@ kOmegaSSTLM<BasicTurbulenceModel>::kOmegaSSTLM
|
|||||||
this->runTime_.timeName(),
|
this->runTime_.timeName(),
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE,
|
||||||
|
IOobject::REGISTER
|
||||||
),
|
),
|
||||||
this->mesh_
|
this->mesh_
|
||||||
),
|
),
|
||||||
|
|||||||
@ -101,14 +101,10 @@ void realizableKE<BasicTurbulenceModel>::correctNut()
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<fvScalarMatrix> realizableKE<BasicTurbulenceModel>::kSource() const
|
tmp<fvScalarMatrix> realizableKE<BasicTurbulenceModel>::kSource() const
|
||||||
{
|
{
|
||||||
return tmp<fvScalarMatrix>
|
return tmp<fvScalarMatrix>::New
|
||||||
(
|
(
|
||||||
new fvScalarMatrix
|
k_,
|
||||||
(
|
dimVolume*this->rho_.dimensions()*k_.dimensions()/dimTime
|
||||||
k_,
|
|
||||||
dimVolume*this->rho_.dimensions()*k_.dimensions()
|
|
||||||
/dimTime
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,14 +112,10 @@ tmp<fvScalarMatrix> realizableKE<BasicTurbulenceModel>::kSource() const
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<fvScalarMatrix> realizableKE<BasicTurbulenceModel>::epsilonSource() const
|
tmp<fvScalarMatrix> realizableKE<BasicTurbulenceModel>::epsilonSource() const
|
||||||
{
|
{
|
||||||
return tmp<fvScalarMatrix>
|
return tmp<fvScalarMatrix>::New
|
||||||
(
|
(
|
||||||
new fvScalarMatrix
|
epsilon_,
|
||||||
(
|
dimVolume*this->rho_.dimensions()*epsilon_.dimensions()/dimTime
|
||||||
epsilon_,
|
|
||||||
dimVolume*this->rho_.dimensions()*epsilon_.dimensions()
|
|
||||||
/dimTime
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,8 @@ Foam::eddyViscosity<BasicTurbulenceModel>::eddyViscosity
|
|||||||
this->runTime_.timeName(),
|
this->runTime_.timeName(),
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE,
|
||||||
|
IOobject::REGISTER
|
||||||
),
|
),
|
||||||
this->mesh_
|
this->mesh_
|
||||||
)
|
)
|
||||||
@ -104,22 +105,12 @@ Foam::eddyViscosity<BasicTurbulenceModel>::R() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmp<volSymmTensorField>
|
return volSymmTensorField::New
|
||||||
(
|
(
|
||||||
new volSymmTensorField
|
IOobject::groupName("R", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject
|
((2.0/3.0)*I)*tk() - (nut_)*devTwoSymm(fvc::grad(this->U_)),
|
||||||
(
|
patchFieldTypes
|
||||||
IOobject::groupName("R", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
IOobject::NO_REGISTER
|
|
||||||
),
|
|
||||||
((2.0/3.0)*I)*tk() - (nut_)*devTwoSymm(fvc::grad(this->U_)),
|
|
||||||
patchFieldTypes
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -89,17 +89,10 @@ template<class BasicTurbulenceModel>
|
|||||||
tmp<volScalarField>
|
tmp<volScalarField>
|
||||||
Stokes<BasicTurbulenceModel>::nut() const
|
Stokes<BasicTurbulenceModel>::nut() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>::New
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::groupName("nut", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("nut", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
IOobject::NO_REGISTER
|
|
||||||
),
|
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
dimensionedScalar(dimViscosity, Zero)
|
dimensionedScalar(dimViscosity, Zero)
|
||||||
);
|
);
|
||||||
@ -113,10 +106,7 @@ Stokes<BasicTurbulenceModel>::nut
|
|||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<scalarField>
|
return tmp<scalarField>::New(this->mesh_.boundary()[patchi].size(), Zero);
|
||||||
(
|
|
||||||
new scalarField(this->mesh_.boundary()[patchi].size(), Zero)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -124,12 +114,11 @@ template<class BasicTurbulenceModel>
|
|||||||
tmp<volScalarField>
|
tmp<volScalarField>
|
||||||
Stokes<BasicTurbulenceModel>::nuEff() const
|
Stokes<BasicTurbulenceModel>::nuEff() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
new volScalarField
|
IOobject::groupName("nuEff", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("nuEff", this->alphaRhoPhi_.group()), this->nu()
|
this->nu()
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -189,17 +189,10 @@ template<class BasicTurbulenceModel>
|
|||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::volScalarField>
|
||||||
Foam::laminarModel<BasicTurbulenceModel>::nut() const
|
Foam::laminarModel<BasicTurbulenceModel>::nut() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>::New
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::groupName("nut", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("nut", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
IOobject::NO_REGISTER
|
|
||||||
),
|
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
dimensionedScalar(dimViscosity, Zero)
|
dimensionedScalar(dimViscosity, Zero)
|
||||||
);
|
);
|
||||||
@ -213,10 +206,7 @@ Foam::laminarModel<BasicTurbulenceModel>::nut
|
|||||||
const label patchi
|
const label patchi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<scalarField>
|
return tmp<scalarField>::New(this->mesh_.boundary()[patchi].size(), Zero);
|
||||||
(
|
|
||||||
new scalarField(this->mesh_.boundary()[patchi].size(), Zero)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -224,12 +214,11 @@ template<class BasicTurbulenceModel>
|
|||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::volScalarField>
|
||||||
Foam::laminarModel<BasicTurbulenceModel>::nuEff() const
|
Foam::laminarModel<BasicTurbulenceModel>::nuEff() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
new volScalarField
|
IOobject::groupName("nuEff", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("nuEff", this->alphaRhoPhi_.group()), this->nu()
|
this->nu()
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,17 +238,10 @@ template<class BasicTurbulenceModel>
|
|||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::volScalarField>
|
||||||
Foam::laminarModel<BasicTurbulenceModel>::k() const
|
Foam::laminarModel<BasicTurbulenceModel>::k() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>::New
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::groupName("k", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("k", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
IOobject::NO_REGISTER
|
|
||||||
),
|
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
dimensionedScalar(sqr(this->U_.dimensions()), Zero)
|
dimensionedScalar(sqr(this->U_.dimensions()), Zero)
|
||||||
);
|
);
|
||||||
@ -270,17 +252,10 @@ template<class BasicTurbulenceModel>
|
|||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::volScalarField>
|
||||||
Foam::laminarModel<BasicTurbulenceModel>::epsilon() const
|
Foam::laminarModel<BasicTurbulenceModel>::epsilon() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>::New
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
IOobject::NO_REGISTER
|
|
||||||
),
|
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
dimensionedScalar(sqr(this->U_.dimensions())/dimTime, Zero)
|
dimensionedScalar(sqr(this->U_.dimensions())/dimTime, Zero)
|
||||||
);
|
);
|
||||||
@ -291,17 +266,10 @@ template<class BasicTurbulenceModel>
|
|||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::volScalarField>
|
||||||
Foam::laminarModel<BasicTurbulenceModel>::omega() const
|
Foam::laminarModel<BasicTurbulenceModel>::omega() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>::New
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
IOobject::NO_REGISTER
|
|
||||||
),
|
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
dimensionedScalar(dimless/dimTime, Zero)
|
dimensionedScalar(dimless/dimTime, Zero)
|
||||||
);
|
);
|
||||||
@ -312,17 +280,10 @@ template<class BasicTurbulenceModel>
|
|||||||
Foam::tmp<Foam::volSymmTensorField>
|
Foam::tmp<Foam::volSymmTensorField>
|
||||||
Foam::laminarModel<BasicTurbulenceModel>::R() const
|
Foam::laminarModel<BasicTurbulenceModel>::R() const
|
||||||
{
|
{
|
||||||
return tmp<volSymmTensorField>::New
|
return volSymmTensorField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::groupName("R", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("R", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
IOobject::NO_REGISTER
|
|
||||||
),
|
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
dimensionedSymmTensor(sqr(this->U_.dimensions()), Zero)
|
dimensionedSymmTensor(sqr(this->U_.dimensions()), Zero)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -80,17 +80,10 @@ tmp<volScalarField> kL<BasicTurbulenceModel>::epsilonCanopy() const
|
|||||||
return Cd*LAD*mag(U)*k_;
|
return Cd*LAD*mag(U)*k_;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmp<volScalarField>::New
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::groupName("epsilonCanopy", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("epsilonCanopy", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
IOobject::NO_REGISTER
|
|
||||||
),
|
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
dimensionedScalar(sqr(dimLength)/pow3(dimTime), Zero)
|
dimensionedScalar(sqr(dimLength)/pow3(dimTime), Zero)
|
||||||
);
|
);
|
||||||
@ -118,26 +111,22 @@ tmp<volScalarField> kL<BasicTurbulenceModel>::epsilon() const
|
|||||||
template<class BasicTurbulenceModel>
|
template<class BasicTurbulenceModel>
|
||||||
tmp<volScalarField> kL<BasicTurbulenceModel>::canopyHeight() const
|
tmp<volScalarField> kL<BasicTurbulenceModel>::canopyHeight() const
|
||||||
{
|
{
|
||||||
const auto* canopyHeightPtr =
|
tmp<volScalarField> tcanopy;
|
||||||
this->mesh_.template findObject<volScalarField>("canopyHeight");
|
|
||||||
|
|
||||||
if (canopyHeightPtr)
|
tcanopy.cref
|
||||||
|
(
|
||||||
|
this->mesh_.template cfindObject<volScalarField>("canopyHeight")
|
||||||
|
);
|
||||||
|
|
||||||
|
if (tcanopy)
|
||||||
{
|
{
|
||||||
const auto& canopyHeight = *canopyHeightPtr;
|
return tcanopy;
|
||||||
return canopyHeight;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmp<volScalarField>::New
|
return volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::groupName("canopyHeight", this->alphaRhoPhi_.group()),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
IOobject::groupName("canopyHeight", this->alphaRhoPhi_.group()),
|
|
||||||
this->runTime_.timeName(),
|
|
||||||
this->mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
IOobject::NO_REGISTER
|
|
||||||
),
|
|
||||||
this->mesh_,
|
this->mesh_,
|
||||||
dimensionedScalar(dimLength, Zero)
|
dimensionedScalar(dimLength, Zero)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 IH-Cantabria
|
Copyright (C) 2017 IH-Cantabria
|
||||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -56,16 +56,10 @@ namespace fv
|
|||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::volScalarField>
|
||||||
Foam::fv::multiphaseMangrovesSource::dragCoeff(const volVectorField& U) const
|
Foam::fv::multiphaseMangrovesSource::dragCoeff(const volVectorField& U) const
|
||||||
{
|
{
|
||||||
auto tdragCoeff = tmp<volScalarField>::New
|
auto tdragCoeff = volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::scopedName(typeName, "dragCoeff"),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
typeName + ":dragCoeff",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_.time(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(dimless/dimTime, Zero)
|
dimensionedScalar(dimless/dimTime, Zero)
|
||||||
);
|
);
|
||||||
@ -101,16 +95,10 @@ Foam::fv::multiphaseMangrovesSource::dragCoeff(const volVectorField& U) const
|
|||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::volScalarField>
|
||||||
Foam::fv::multiphaseMangrovesSource::inertiaCoeff() const
|
Foam::fv::multiphaseMangrovesSource::inertiaCoeff() const
|
||||||
{
|
{
|
||||||
auto tinertiaCoeff = tmp<volScalarField>::New
|
auto tinertiaCoeff = volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::scopedName(typeName, "inertiaCoeff"),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
typeName + ":inertiaCoeff",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_.time(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(dimless, Zero)
|
dimensionedScalar(dimless, Zero)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 IH-Cantabria
|
Copyright (C) 2017 IH-Cantabria
|
||||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -58,21 +58,14 @@ Foam::fv::multiphaseMangrovesTurbulenceModel::kCoeff
|
|||||||
const volVectorField& U
|
const volVectorField& U
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
auto tkCoeff = tmp<volScalarField>::New
|
auto tkCoeff = volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::scopedName(typeName, "kCoeff"),
|
||||||
(
|
IOobject::NO_REGISTER,
|
||||||
typeName + ":kCoeff",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_.time(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(dimless/dimTime, Zero)
|
dimensionedScalar(dimless/dimTime, Zero)
|
||||||
);
|
);
|
||||||
|
auto& kCoeff = tkCoeff.ref();
|
||||||
volScalarField& kCoeff = tkCoeff.ref();
|
|
||||||
|
|
||||||
forAll(zoneIDs_, i)
|
forAll(zoneIDs_, i)
|
||||||
{
|
{
|
||||||
@ -104,21 +97,13 @@ Foam::fv::multiphaseMangrovesTurbulenceModel::epsilonCoeff
|
|||||||
const volVectorField& U
|
const volVectorField& U
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
auto tepsilonCoeff = tmp<volScalarField>::New
|
auto tepsilonCoeff = volScalarField::New
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject::scopedName(typeName, "epsilonCoeff"),
|
||||||
(
|
|
||||||
typeName + ":epsilonCoeff",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_.time(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(dimless/dimTime, Zero)
|
dimensionedScalar(dimless/dimTime, Zero)
|
||||||
);
|
);
|
||||||
|
auto& epsilonCoeff = tepsilonCoeff.ref();
|
||||||
volScalarField& epsilonCoeff = tepsilonCoeff.ref();
|
|
||||||
|
|
||||||
forAll(zoneIDs_, i)
|
forAll(zoneIDs_, i)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user