diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C index 2855d99921..142b7d97df 100644 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C +++ b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C @@ -42,7 +42,35 @@ Foam::fluidThermo::implementation::implementation const word& phaseName ) : - p_(lookupOrConstruct(mesh, "p")) + p_(lookupOrConstruct(mesh, "p")), + + psi_ + ( + IOobject + ( + phasePropertyName("psi", phaseName), + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, -2, 2, 0, 0) + ), + + mu_ + ( + IOobject + ( + phasePropertyName("mu", phaseName), + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(1, -1, -1, 0, 0) + ) {} @@ -95,4 +123,25 @@ const Foam::volScalarField& Foam::fluidThermo::implementation::p() const } +const Foam::volScalarField& Foam::fluidThermo::implementation::psi() const +{ + return psi_; +} + + +Foam::tmp Foam::fluidThermo::implementation::mu() const +{ + return mu_; +} + + +Foam::tmp Foam::fluidThermo::implementation::mu +( + const label patchi +) const +{ + return mu_.boundaryField()[patchi]; +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H index f0251dbceb..1a2dca66dd 100644 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H +++ b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H @@ -169,6 +169,12 @@ protected: //- Pressure [Pa] volScalarField& p_; + //- Compressibility [s^2/m^2] + volScalarField psi_; + + //- Dynamic viscosity [kg/m/s] + volScalarField mu_; + public: @@ -196,6 +202,18 @@ public: //- Pressure [Pa] virtual const volScalarField& p() const; + //- Compressibility [s^2/m^2] + virtual const volScalarField& psi() const; + + + // Access to transport state variables + + //- Dynamic viscosity of mixture [kg/m/s] + virtual tmp mu() const; + + //- Dynamic viscosity of mixture for patch [kg/m/s] + virtual tmp mu(const label patchi) const; + // Member Operators diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo.C b/src/thermophysicalModels/basic/psiThermo/psiThermo.C index 3caa1f77f1..166ae479d3 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/psiThermo.C @@ -41,34 +41,6 @@ Foam::psiThermo::implementation::implementation const fvMesh& mesh, const word& phaseName ) -: - psi_ - ( - IOobject - ( - phasePropertyName("psi", phaseName), - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionSet(0, -2, 2, 0, 0) - ), - - mu_ - ( - IOobject - ( - phasePropertyName("mu", phaseName), - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionSet(1, -1, -1, 0, 0) - ) {} @@ -102,7 +74,7 @@ void Foam::psiThermo::correctRho(const Foam::volScalarField& deltaRho) Foam::tmp Foam::psiThermo::implementation::rho() const { - return p()*psi_; + return p()*psi(); } @@ -111,7 +83,7 @@ Foam::tmp Foam::psiThermo::implementation::rho const label patchi ) const { - return p().boundaryField()[patchi]*psi_.boundaryField()[patchi]; + return p().boundaryField()[patchi]*psi().boundaryField()[patchi]; } @@ -123,28 +95,7 @@ Foam::tmp Foam::psiThermo::implementation::renameRho() Foam::tmp Foam::psiThermo::implementation::rho0() const { - return p().oldTime()*psi_.oldTime(); -} - - -const Foam::volScalarField& Foam::psiThermo::implementation::psi() const -{ - return psi_; -} - - -Foam::tmp Foam::psiThermo::implementation::mu() const -{ - return mu_; -} - - -Foam::tmp Foam::psiThermo::implementation::mu -( - const label patchi -) const -{ - return mu_.boundaryField()[patchi]; + return p().oldTime()*psi().oldTime(); } diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo.H b/src/thermophysicalModels/basic/psiThermo/psiThermo.H index eba01d9b9c..48784bf313 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/psiThermo.H @@ -114,18 +114,6 @@ public: //- Old-time density [kg/m^3] virtual tmp rho0() const = 0; - - //- Compressibility [s^2/m^2] - virtual const volScalarField& psi() const = 0; - - - // Access to transport state variables - - //- Dynamic viscosity of mixture [kg/m/s] - virtual tmp mu() const = 0; - - //- Dynamic viscosity of mixture for patch [kg/m/s] - virtual tmp mu(const label patchi) const = 0; }; @@ -137,18 +125,6 @@ class psiThermo::implementation : virtual public psiThermo { -protected: - - // Protected data - - // Fields - - //- Compressibility [s^2/m^2] - volScalarField psi_; - - //- Dynamic viscosity [kg/m/s] - volScalarField mu_; - public: @@ -182,18 +158,6 @@ public: //- Old-time density [kg/m^3] virtual tmp rho0() const; - //- Compressibility [s^2/m^2] - virtual const volScalarField& psi() const; - - - // Access to transport state variables - - //- Dynamic viscosity of mixture [kg/m/s] - virtual tmp mu() const; - - //- Dynamic viscosity of mixture for patch [kg/m/s] - virtual tmp mu(const label patchi) const; - // Member Operators diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C index 14d773d373..f3cd64530c 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C @@ -54,34 +54,6 @@ Foam::rhoThermo::implementation::implementation ), mesh, dimDensity - ), - - psi_ - ( - IOobject - ( - phasePropertyName("psi", phaseName), - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionSet(0, -2, 2, 0, 0) - ), - - mu_ - ( - IOobject - ( - phasePropertyName("mu", phaseName), - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionSet(1, -1, -1, 0, 0) ) {} @@ -150,25 +122,4 @@ void Foam::rhoThermo::implementation::correctRho(const volScalarField& deltaRho) } -const Foam::volScalarField& Foam::rhoThermo::implementation::psi() const -{ - return psi_; -} - - -Foam::tmp Foam::rhoThermo::implementation::mu() const -{ - return mu_; -} - - -Foam::tmp Foam::rhoThermo::implementation::mu -( - const label patchi -) const -{ - return mu_.boundaryField()[patchi]; -} - - // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H index 5d9f6c0020..0ec3fe6bff 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H @@ -117,18 +117,6 @@ public: //- Add the given density correction to the density field. // Used to update the density field following pressure solution virtual void correctRho(const volScalarField& deltaRho) = 0; - - //- Compressibility [s^2/m^2] - virtual const volScalarField& psi() const = 0; - - - // Access to transport state variables - - //- Dynamic viscosity of mixture [kg/m/s] - virtual tmp mu() const = 0; - - //- Dynamic viscosity of mixture for patch [kg/m/s] - virtual tmp mu(const label patchi) const = 0; }; @@ -148,12 +136,6 @@ protected: // Named 'rho' to avoid (potential) conflict with solver density volScalarField rho_; - //- Compressibility [s^2/m^2] - volScalarField psi_; - - //- Dynamic viscosity [kg/m/s] - volScalarField mu_; - public: @@ -194,18 +176,6 @@ public: // Used to update the density field following pressure solution virtual void correctRho(const volScalarField& deltaRho); - //- Compressibility [s^2/m^2] - virtual const volScalarField& psi() const; - - - // Access to transport state variables - - //- Dynamic viscosity of mixture [kg/m/s] - virtual tmp mu() const; - - //- Dynamic viscosity of mixture for patch [kg/m/s] - virtual tmp mu(const label patchi) const; - // Member Operators