diff --git a/applications/solvers/modules/isothermalFilm/isothermalFilm.H b/applications/solvers/modules/isothermalFilm/isothermalFilm.H index 6983d6f6d8..f834dd266e 100644 --- a/applications/solvers/modules/isothermalFilm/isothermalFilm.H +++ b/applications/solvers/modules/isothermalFilm/isothermalFilm.H @@ -174,27 +174,6 @@ protected: tmp tUEqn; -public: - - // Constant access to the physical state - - //- Film thickness - const volScalarField& delta; - - //- Film volume fraction in the cell layer - const volScalarField& alpha; - - //- Reference to the fluid thermophysical properties - const fluidThermo& thermo; - - //- The thermodynamic density field - const volScalarField& rho; - - //- Film velocity field - const volVectorField& U; - - - private: // Private Member Functions @@ -268,10 +247,32 @@ private: protected: + // Protected Member Functions + //- Read controls void readControls(); +public: + + // Public Data + + //- Film thickness + const volScalarField& delta; + + //- Film volume fraction in the cell layer + const volScalarField& alpha; + + //- Reference to the fluid thermophysical properties + const fluidThermo& thermo; + + //- The thermodynamic density field + const volScalarField& rho; + + //- Film velocity field + const volVectorField& U; + + public: //- Runtime type information diff --git a/applications/solvers/modules/solid/solid.C b/applications/solvers/modules/solid/solid.C index 0294ea1c2b..3bf01eac02 100644 --- a/applications/solvers/modules/solid/solid.C +++ b/applications/solvers/modules/solid/solid.C @@ -87,14 +87,17 @@ Foam::solvers::solid::solid : solver(mesh), - thermo_(thermoPtr), - thermo(thermo_()), + thermoPtr_(thermoPtr), + thermo_(thermoPtr_()), - T(thermo.T()), + T_(thermo_.T()), - thermophysicalTransport(solidThermophysicalTransportModel::New(thermo)), + thermophysicalTransport(solidThermophysicalTransportModel::New(thermo_)), - DiNum(0) + DiNum(0), + + thermo(thermo_), + T(T_) { thermo.validate("solid", "h", "e"); @@ -192,7 +195,7 @@ void Foam::solvers::solid::momentumPredictor() void Foam::solvers::solid::thermophysicalPredictor() { - volScalarField& e = thermo.he(); + volScalarField& e = thermo_.he(); const volScalarField& rho = thermo.rho(); while (pimple.correctNonOrthogonal()) @@ -214,7 +217,7 @@ void Foam::solvers::solid::thermophysicalPredictor() fvConstraints().constrain(e); } - thermo.correct(); + thermo_.correct(); } diff --git a/applications/solvers/modules/solid/solid.H b/applications/solvers/modules/solid/solid.H index 9d7a6a77f8..5a92ce5d6c 100644 --- a/applications/solvers/modules/solid/solid.H +++ b/applications/solvers/modules/solid/solid.H @@ -67,11 +67,11 @@ protected: // Thermophysical properties - autoPtr thermo_; + autoPtr thermoPtr_; - solidThermo& thermo; + solidThermo& thermo_; - volScalarField& T; + volScalarField& T_; // Thermophysical transport @@ -101,6 +101,15 @@ private: public: + // Public Data + + //- Reference to the solid thermophysical properties + const solidThermo& thermo; + + //- Reference to the temperature field + const volScalarField& T; + + //- Runtime type information TypeName("solid"); diff --git a/applications/solvers/modules/solidDisplacement/solidDisplacement.C b/applications/solvers/modules/solidDisplacement/solidDisplacement.C index bd01d9f119..7b6945910c 100644 --- a/applications/solvers/modules/solidDisplacement/solidDisplacement.C +++ b/applications/solvers/modules/solidDisplacement/solidDisplacement.C @@ -66,11 +66,11 @@ Foam::solvers::solidDisplacement::solidDisplacement(fvMesh& mesh) autoPtr(new solidDisplacementThermo(mesh)) ), - thermo(refCast(solid::thermo)), + thermo_(refCast(solid::thermo_)), compactNormalStress(pimple.dict().lookup("compactNormalStress")), - D + D_ ( IOobject ( @@ -83,26 +83,26 @@ Foam::solvers::solidDisplacement::solidDisplacement(fvMesh& mesh) mesh ), - E(thermo.E()), - nu(thermo.nu()), + E(thermo_.E()), + nu(thermo_.nu()), mu(E/(2*(1 + nu))), lambda ( - thermo.planeStress() + thermo_.planeStress() ? nu*E/((1 + nu)*(1 - nu)) : nu*E/((1 + nu)*(1 - 2*nu)) ), threeK ( - thermo.planeStress() + thermo_.planeStress() ? E/(1 - nu) : E/(1 - 2*nu) ), - threeKalpha("threeKalpha", threeK*thermo.alphav()), + threeKalpha("threeKalpha", threeK*thermo_.alphav()), sigmaD ( @@ -112,7 +112,7 @@ Foam::solvers::solidDisplacement::solidDisplacement(fvMesh& mesh) runTime.name(), mesh ), - mu*twoSymm(fvc::grad(D)) + lambda*(I*tr(fvc::grad(D))) + mu*twoSymm(fvc::grad(D_)) + lambda*(I*tr(fvc::grad(D_))) ), divSigmaExp @@ -126,10 +126,13 @@ Foam::solvers::solidDisplacement::solidDisplacement(fvMesh& mesh) fvc::div(sigmaD) - ( compactNormalStress - ? fvc::laplacian(2*mu + lambda, D, "laplacian(DD,D)") - : fvc::div((2*mu + lambda)*fvc::grad(D), "div(sigmaD)") + ? fvc::laplacian(2*mu + lambda, D_, "laplacian(DD,D)") + : fvc::div((2*mu + lambda)*fvc::grad(D_), "div(sigmaD)") ) - ) + ), + + thermo(thermo_), + D(D_) { mesh.schemes().setFluxRequired(D.name()); @@ -166,6 +169,8 @@ void Foam::solvers::solidDisplacement::thermophysicalPredictor() void Foam::solvers::solidDisplacement::pressureCorrector() { + volVectorField& D(D_); + const volScalarField& rho = thermo.rho(); int iCorr = 0; diff --git a/applications/solvers/modules/solidDisplacement/solidDisplacement.H b/applications/solvers/modules/solidDisplacement/solidDisplacement.H index 03c2f57f6a..ff73d84e65 100644 --- a/applications/solvers/modules/solidDisplacement/solidDisplacement.H +++ b/applications/solvers/modules/solidDisplacement/solidDisplacement.H @@ -63,7 +63,7 @@ protected: // Thermophysical properties - solidDisplacementThermo& thermo; + solidDisplacementThermo& thermo_; // Solution algorithm controls @@ -93,7 +93,7 @@ protected: // Kinematic properties //- Displacement field - volVectorField D; + volVectorField D_; //- Young's modulus const volScalarField& E; @@ -129,6 +129,15 @@ protected: public: + // Public Data + + //- Reference to the solid thermophysical properties + const solidDisplacementThermo& thermo; + + //- Reference to the Displacement field + const volVectorField& D; + + //- Runtime type information TypeName("solidDisplacement"); diff --git a/src/finiteVolume/solver/solver.C b/src/finiteVolume/solver/solver.C index 5c64cecae8..b94cde2747 100644 --- a/src/finiteVolume/solver/solver.C +++ b/src/finiteVolume/solver/solver.C @@ -62,19 +62,15 @@ Foam::solver::solver(fvMesh& mesh) ), mesh_(mesh), - steady(mesh_.schemes().steady()), - LTS(fv::localEulerDdt::enabled(mesh)), - mesh(mesh_), - - runTime(mesh_.time()), - - pimple(mesh_), - fvModelsPtr(nullptr), - fvConstraintsPtr(nullptr) + fvConstraintsPtr(nullptr), + + mesh(mesh_), + runTime(mesh_.time()), + pimple(mesh_) {} diff --git a/src/finiteVolume/solver/solver.H b/src/finiteVolume/solver/solver.H index 89c1623d19..83994e578b 100644 --- a/src/finiteVolume/solver/solver.H +++ b/src/finiteVolume/solver/solver.H @@ -70,23 +70,6 @@ protected: bool LTS; -public: - - // Public Data - - //- Region mesh - const fvMesh& mesh; - - //- Time - const Time& runTime; - - //- PIMPLE inner-loop controls - pimpleNoLoopControl pimple; - - //- deltaT increase factor - static scalar deltaTFactor; - - private: // Private Member Data @@ -106,6 +89,21 @@ private: public: + // Public Data + + //- Region mesh + const fvMesh& mesh; + + //- Time + const Time& runTime; + + //- PIMPLE inner-loop controls + pimpleNoLoopControl pimple; + + //- deltaT increase factor + static scalar deltaTFactor; + + //- Runtime type information TypeName("solver");