Commit 2cd6071c authored by Kutalmis Bercin's avatar Kutalmis Bercin
Browse files

ENH: enable custom input of U for devRhoReff and devReff

parent 6f20499b
......@@ -149,6 +149,17 @@ Foam::DPMIncompressibleTurbulenceModel<TransportModel>::devReff() const
}
template<class TransportModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::DPMIncompressibleTurbulenceModel<TransportModel>::devReff
(
const volVectorField& U
) const
{
return devRhoReff(U);
}
template<class TransportModel>
Foam::tmp<Foam::fvVectorMatrix>
Foam::DPMIncompressibleTurbulenceModel<TransportModel>::divDevReff
......@@ -170,6 +181,19 @@ Foam::DPMIncompressibleTurbulenceModel<TransportModel>::devRhoReff() const
}
template<class TransportModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::DPMIncompressibleTurbulenceModel<TransportModel>::devRhoReff
(
const volVectorField& U
) const
{
NotImplemented;
return devReff(U);
}
template<class TransportModel>
Foam::tmp<Foam::fvVectorMatrix>
Foam::DPMIncompressibleTurbulenceModel<TransportModel>::divDevRhoReff
......
......@@ -116,12 +116,24 @@ public:
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devRhoReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
};
......
......@@ -123,6 +123,13 @@ public:
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devRhoReff() const = 0;
//- Return the effective stress tensor including
//- the laminar stress based on a given velocity field
virtual tmp<volSymmTensorField> devRhoReff
(
const volVectorField& U
) const = 0;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0;
......
......@@ -107,6 +107,17 @@ Foam::IncompressibleTurbulenceModel<TransportModel>::devReff() const
}
template<class TransportModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::IncompressibleTurbulenceModel<TransportModel>::devReff
(
const volVectorField& U
) const
{
return devRhoReff(U);
}
template<class TransportModel>
Foam::tmp<Foam::fvVectorMatrix>
Foam::IncompressibleTurbulenceModel<TransportModel>::divDevReff
......@@ -128,6 +139,19 @@ Foam::IncompressibleTurbulenceModel<TransportModel>::devRhoReff() const
}
template<class TransportModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::IncompressibleTurbulenceModel<TransportModel>::devRhoReff
(
const volVectorField& U
) const
{
NotImplemented;
return devReff(U);
}
template<class TransportModel>
Foam::tmp<Foam::fvVectorMatrix>
Foam::IncompressibleTurbulenceModel<TransportModel>::divDevRhoReff
......
......@@ -108,12 +108,24 @@ public:
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devRhoReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
......
......@@ -139,6 +139,13 @@ public:
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devReff() const = 0;
//- Return the effective stress tensor including
//- the laminar stress based on a given velocity field
virtual tmp<volSymmTensorField> devReff
(
const volVectorField& U
) const = 0;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0;
};
......
......@@ -138,6 +138,13 @@ public:
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devReff() const = 0;
//- Return the effective stress tensor including
//- the laminar stress based on a given velocity field
virtual tmp<volSymmTensorField> devReff
(
const volVectorField& U
) const = 0;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0;
};
......
......@@ -150,6 +150,17 @@ Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::devReff() const
}
template<class TransportModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::devReff
(
const volVectorField& U
) const
{
return devRhoReff(U);
}
template<class TransportModel>
Foam::tmp<Foam::fvVectorMatrix>
Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::divDevReff
......@@ -171,6 +182,19 @@ Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::devRhoReff() const
}
template<class TransportModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::devRhoReff
(
const volVectorField& U
) const
{
NotImplemented;
return devReff(U);
}
template<class TransportModel>
Foam::tmp<Foam::fvVectorMatrix>
Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::divDevRhoReff
......
......@@ -117,12 +117,24 @@ public:
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devRhoReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
};
......
......@@ -208,6 +208,17 @@ Foam::ReynoldsStress<BasicTurbulenceModel>::k() const
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::ReynoldsStress<BasicTurbulenceModel>::devRhoReff() const
{
return devRhoReff(this->U_);
}
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::ReynoldsStress<BasicTurbulenceModel>::devRhoReff
(
const volVectorField& U
) const
{
return tmp<volSymmTensorField>
(
......@@ -223,7 +234,7 @@ Foam::ReynoldsStress<BasicTurbulenceModel>::devRhoReff() const
),
this->alpha_*this->rho_*R_
- (this->alpha_*this->rho_*this->nu())
*dev(twoSymm(fvc::grad(this->U_)))
*dev(twoSymm(fvc::grad(U)))
)
);
}
......
......@@ -140,6 +140,12 @@ public:
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devRhoReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
......
......@@ -104,6 +104,7 @@ bool Maxwell<BasicTurbulenceModel>::read()
return false;
}
template<class BasicTurbulenceModel>
tmp<Foam::volSymmTensorField>
Maxwell<BasicTurbulenceModel>::R() const
......@@ -111,9 +112,18 @@ Maxwell<BasicTurbulenceModel>::R() const
return sigma_;
}
template<class BasicTurbulenceModel>
tmp<Foam::volSymmTensorField>
Maxwell<BasicTurbulenceModel>::devRhoReff() const
{
return devRhoReff(this->U_);
}
template<class BasicTurbulenceModel>
tmp<Foam::volSymmTensorField>
Maxwell<BasicTurbulenceModel>::devRhoReff(const volVectorField& U) const
{
return tmp<volSymmTensorField>
(
......@@ -129,7 +139,7 @@ Maxwell<BasicTurbulenceModel>::devRhoReff() const
),
this->alpha_*this->rho_*sigma_
- (this->alpha_*this->rho_*this->nu())
*dev(twoSymm(fvc::grad(this->U_)))
*dev(twoSymm(fvc::grad(U)))
)
);
}
......
......@@ -143,6 +143,12 @@ public:
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devRhoReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
......
......@@ -70,6 +70,17 @@ bool Foam::linearViscousStress<BasicTurbulenceModel>::read()
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::linearViscousStress<BasicTurbulenceModel>::devRhoReff() const
{
return devRhoReff(this->U_);
}
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::linearViscousStress<BasicTurbulenceModel>::devRhoReff
(
const volVectorField& U
) const
{
return tmp<volSymmTensorField>
(
......@@ -84,7 +95,7 @@ Foam::linearViscousStress<BasicTurbulenceModel>::devRhoReff() const
IOobject::NO_WRITE
),
(-(this->alpha_*this->rho_*this->nuEff()))
*dev(twoSymm(fvc::grad(this->U_)))
*dev(twoSymm(fvc::grad(U)))
)
);
}
......
......@@ -91,6 +91,12 @@ public:
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devRhoReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
......
......@@ -88,12 +88,24 @@ Foam::nonlinearEddyViscosity<BasicTurbulenceModel>::R() const
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::nonlinearEddyViscosity<BasicTurbulenceModel>::devRhoReff() const
{
return devRhoReff(this->U_);
}
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::nonlinearEddyViscosity<BasicTurbulenceModel>::devRhoReff
(
const volVectorField& U
) const
{
tmp<volSymmTensorField> tdevRhoReff
(
eddyViscosity<BasicTurbulenceModel>::devRhoReff()
eddyViscosity<BasicTurbulenceModel>::devRhoReff(U)
);
tdevRhoReff.ref() += this->rho_*nonlinearStress_;
return tdevRhoReff;
}
......
......@@ -107,6 +107,12 @@ public:
//- Return the effective stress tensor
virtual tmp<volSymmTensorField> devRhoReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devRhoReff
(
const volVectorField& U
) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
......
......@@ -71,6 +71,15 @@ adjointLaminar::adjointLaminar
tmp<volSymmTensorField> adjointLaminar::devReff() const
{
const volVectorField& Ua = adjointVars_.Ua();
return devReff(Ua);
}
tmp<volSymmTensorField> adjointLaminar::devReff
(
const volVectorField& U
) const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
......@@ -83,7 +92,7 @@ tmp<volSymmTensorField> adjointLaminar::devReff() const
IOobject::NO_READ,
IOobject::NO_WRITE
),
-nu()*dev(twoSymm(fvc::grad(Ua)))
-nu()*dev(twoSymm(fvc::grad(U)))
)
);
}
......
......@@ -100,6 +100,12 @@ public:
//- Return the effective stress tensor, i.e. the adjointLaminar stress
virtual tmp<volSymmTensorField> devReff() const;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devReff
(
const volVectorField& U
) const;
//- Return the diffusion term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
......
......@@ -261,6 +261,12 @@ public:
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devReff() const = 0;
//- Return the effective stress tensor based on a given velocity field
virtual tmp<volSymmTensorField> devReff
(
const volVectorField& U
) const = 0;
//- Return the diffusion term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment