diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index 03217979c0..7a9782a372 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -87,10 +87,13 @@ int main(int argc, char *argv[]) autoPtr divrhoU; if (correctPhi) { - divrhoU = new volScalarField + divrhoU.reset ( - "divrhoU", - fvc::div(fvc::absolute(phi, rho, U)) + new volScalarField + ( + "divrhoU", + fvc::div(fvc::absolute(phi, rho, U)) + ) ); } @@ -112,7 +115,7 @@ int main(int argc, char *argv[]) autoPtr rhoU; if (rhoUf.valid()) { - rhoU = new volVectorField("rhoU", rho*U); + rhoU.reset(new volVectorField("rhoU", rho*U)); } // Do any mesh changes diff --git a/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C b/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C index 38032cf67e..71f0be0df5 100644 --- a/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C @@ -56,7 +56,6 @@ int main(int argc, char *argv[]) #include "readEngineTimeControls.H" #include "createFields.H" #include "createFieldRefs.H" - #include "createFvOptions.H" #include "createRhoUf.H" #include "compressibleCourantNo.H" #include "setInitialDeltaT.H" diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C index 3cfbfe89ed..b75091650a 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C @@ -396,7 +396,7 @@ Foam::tmp Foam::twoPhaseMixtureEThermo::gamma() const { return tmp ( - (alpha1_*Cp1() + alpha2_*Cp2()) / (alpha1_*Cv1() + alpha2_*Cv2()) + (alpha1_*Cp1() + alpha2_*Cp2())/(alpha1_*Cv1() + alpha2_*Cv2()) ); } @@ -429,7 +429,7 @@ Foam::tmp Foam::twoPhaseMixtureEThermo::Cpv const label patchi ) const { - // This is a e thermo (Cpv = Cv) + // This is an e thermo (Cpv = Cv) return Cv(p, T, patchi); } @@ -441,6 +441,13 @@ Foam::tmp Foam::twoPhaseMixtureEThermo::CpByCpv() const } +Foam::tmp Foam::twoPhaseMixtureEThermo::W() const +{ + NotImplemented; + return nullptr; +} + + Foam::tmp Foam::twoPhaseMixtureEThermo::CpByCpv ( const scalarField& p, diff --git a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H index 71713d1535..a63db6f0ff 100644 --- a/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H +++ b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H @@ -233,6 +233,9 @@ public: const label patchi ) const; + //- Molecular weight [kg/kmol] + virtual tmp W() const; + //- Thermal diffusivity for temperature of mixture [J/m/s/K] virtual tmp kappa() const; diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H index 3f2aa7e4d6..7de66a472a 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H @@ -38,8 +38,6 @@ SourceFiles #include "fvMesh.H" -#define MOVING_MESH - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C index 3256f709f9..7163860049 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMeshNew.C @@ -67,22 +67,25 @@ Foam::autoPtr Foam::dynamicFvMesh::New(const IOobject& io) << exit(FatalError); } - IOobjectConstructorTable::iterator cstrIter = - IOobjectConstructorTablePtr_->find(dynamicFvMeshTypeName); + auto cstrIter = + IOobjectConstructorTablePtr_->cfind(dynamicFvMeshTypeName); - if (cstrIter == IOobjectConstructorTablePtr_->end()) + if (!cstrIter.found()) { - FatalErrorInFunction + FatalIOErrorInFunction(dict) << "Unknown dynamicFvMesh type " << dynamicFvMeshTypeName << nl << nl << "Valid dynamicFvMesh types are :" << endl << IOobjectConstructorTablePtr_->sortedToc() - << exit(FatalError); + << exit(FatalIOError); } + #define MOVING_MESH return autoPtr(cstrIter()(io)); } + + #undef MOVING_MESH return autoPtr(new staticFvMesh(io)); } diff --git a/src/finiteVolume/cfdTools/compressible/createRhoUfIfPresent.H b/src/finiteVolume/cfdTools/compressible/createRhoUfIfPresent.H index 0c22396db2..6f9b78205d 100644 --- a/src/finiteVolume/cfdTools/compressible/createRhoUfIfPresent.H +++ b/src/finiteVolume/cfdTools/compressible/createRhoUfIfPresent.H @@ -45,7 +45,7 @@ IOobject rhoUfHeader if (rhoUfHeader.typeHeaderOk(true)) { Info<< "Reading face momentum rhoUf\n" << endl; - rhoUf = new surfaceVectorField(rhoUfHeader, mesh); + rhoUf.reset(new surfaceVectorField(rhoUfHeader, mesh)); } // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/compressible/updateRhoUf.H b/src/finiteVolume/cfdTools/compressible/updateRhoUf.H index e3695732a2..2356481618 100644 --- a/src/finiteVolume/cfdTools/compressible/updateRhoUf.H +++ b/src/finiteVolume/cfdTools/compressible/updateRhoUf.H @@ -37,17 +37,20 @@ if (mesh.changing()) { Info<< "Constructing face momentum rhoUf" << endl; - rhoUf = new surfaceVectorField + rhoUf.reset ( - IOobject + new surfaceVectorField ( - "rhoUf", - runTime.timeName(), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - fvc::interpolate(rho*U) + IOobject + ( + "rhoUf", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + fvc::interpolate(rho*U) + ) ); } } diff --git a/src/finiteVolume/cfdTools/incompressible/createUfIfPresent.H b/src/finiteVolume/cfdTools/incompressible/createUfIfPresent.H index 79e6619eec..fa21a48dd0 100644 --- a/src/finiteVolume/cfdTools/incompressible/createUfIfPresent.H +++ b/src/finiteVolume/cfdTools/incompressible/createUfIfPresent.H @@ -45,7 +45,7 @@ IOobject UfHeader if (UfHeader.typeHeaderOk(true)) { Info<< "Reading face velocity Uf\n" << endl; - Uf = new surfaceVectorField(UfHeader, mesh); + Uf.reset(new surfaceVectorField(UfHeader, mesh)); } // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/incompressible/updateUf.H b/src/finiteVolume/cfdTools/incompressible/updateUf.H index e2cb0b90b4..be5cc269f3 100644 --- a/src/finiteVolume/cfdTools/incompressible/updateUf.H +++ b/src/finiteVolume/cfdTools/incompressible/updateUf.H @@ -37,17 +37,20 @@ if (mesh.changing()) { Info<< "Constructing face velocity Uf" << endl; - Uf = new surfaceVectorField + Uf.reset ( - IOobject + new surfaceVectorField ( - "Uf", - runTime.timeName(), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - fvc::interpolate(U) + IOobject + ( + "Uf", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + fvc::interpolate(U) + ) ); } }