From 2fada7886a2a766432f6bf60103b9f5472bf39a1 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 20 Dec 2018 15:25:41 +0000 Subject: [PATCH] GeometricFields: Removed registration of temporary fields --- .../GeometricScalarField.C | 88 ++++--------------- .../transformGeometricField.C | 22 +---- .../psiuReactionThermo/heheuPsiThermo.C | 65 ++------------ .../pyrolysisChemistryModel.C | 12 +-- .../pyrolysisChemistryModelI.H | 11 +-- .../solidChemistryModel/solidChemistryModel.C | 12 +-- .../solidChemistryModelI.H | 11 +-- .../solidThermo/solidThermo/heSolidThermo.C | 11 +-- 8 files changed, 39 insertions(+), 193 deletions(-) diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C index f4238afe25..ea28bd6fbb 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C @@ -57,16 +57,9 @@ tmp> stabilise { tmp> tRes ( - new GeometricField + GeometricField::New ( - IOobject - ( - "stabilise(" + gsf.name() + ',' + ds.name() + ')', - gsf.instance(), - gsf.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "stabilise(" + gsf.name() + ',' + ds.name() + ')', gsf.mesh(), ds.dimensions() + gsf.dimensions() ) @@ -154,16 +147,9 @@ tmp> pow tmp> tPow ( - new GeometricField + GeometricField::New ( - IOobject - ( - "pow(" + gsf1.name() + ',' + gsf2.name() + ')', - gsf1.instance(), - gsf1.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "pow(" + gsf1.name() + ',' + gsf2.name() + ')', gsf1.mesh(), dimless ) @@ -330,16 +316,9 @@ tmp> pow tmp> tPow ( - new GeometricField + GeometricField::New ( - IOobject - ( - "pow(" + gsf.name() + ',' + ds.name() + ')', - gsf.instance(), - gsf.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "pow(" + gsf.name() + ',' + ds.name() + ')', gsf.mesh(), pow(gsf.dimensions(), ds) ) @@ -440,16 +419,9 @@ tmp> pow tmp> tPow ( - new GeometricField + GeometricField::New ( - IOobject - ( - "pow(" + ds.name() + ',' + gsf.name() + ')', - gsf.instance(), - gsf.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "pow(" + ds.name() + ',' + gsf.name() + ')', gsf.mesh(), dimless ) @@ -556,16 +528,9 @@ tmp> atan2 { tmp> tAtan2 ( - new GeometricField + GeometricField::New ( - IOobject - ( - "atan2(" + gsf1.name() + ',' + gsf2.name() + ')', - gsf1.instance(), - gsf1.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "atan2(" + gsf1.name() + ',' + gsf2.name() + ')', gsf1.mesh(), atan2(gsf1.dimensions(), gsf2.dimensions()) ) @@ -683,16 +648,9 @@ tmp> atan2 { tmp> tAtan2 ( - new GeometricField + GeometricField::New ( - IOobject - ( - "atan2(" + gsf.name() + ',' + ds.name() + ')', - gsf.instance(), - gsf.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "atan2(" + gsf.name() + ',' + ds.name() + ')', gsf.mesh(), atan2(gsf.dimensions(), ds) ) @@ -772,16 +730,9 @@ tmp> atan2 { tmp> tAtan2 ( - new GeometricField + GeometricField::New ( - IOobject - ( - "atan2(" + ds.name() + ',' + gsf.name() + ')', - gsf.instance(), - gsf.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "atan2(" + ds.name() + ',' + gsf.name() + ')', gsf.mesh(), atan2(ds, gsf.dimensions()) ) @@ -913,16 +864,9 @@ tmp> func \ \ tmp> tFunc \ ( \ - new GeometricField \ + GeometricField::New \ ( \ - IOobject \ - ( \ - #func "(" + gsf.name() + ')', \ - gsf.instance(), \ - gsf.db(), \ - IOobject::NO_READ, \ - IOobject::NO_WRITE \ - ), \ + #func "(" + gsf.name() + ')', \ gsf.mesh(), \ dimless \ ) \ diff --git a/src/OpenFOAM/fields/GeometricFields/transformGeometricField/transformGeometricField.C b/src/OpenFOAM/fields/GeometricFields/transformGeometricField/transformGeometricField.C index 070a1cfe98..bf2635f5d9 100644 --- a/src/OpenFOAM/fields/GeometricFields/transformGeometricField/transformGeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/transformGeometricField/transformGeometricField.C @@ -69,16 +69,9 @@ tmp> transform { tmp> tranf ( - new GeometricField + GeometricField::New ( - IOobject - ( - "transform(" + trf.name() + ',' + tf.name() + ')', - tf.instance(), - tf.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "transform(" + trf.name() + ',' + tf.name() + ')', tf.mesh(), tf.dimensions() ) @@ -155,16 +148,9 @@ tmp> transform { tmp> tranf ( - new GeometricField + GeometricField::New ( - IOobject - ( - "transform(" + t.name() + ',' + tf.name() + ')', - tf.instance(), - tf.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "transform(" + t.name() + ',' + tf.name() + ')', tf.mesh(), tf.dimensions() ) diff --git a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C index 72b51e8112..1a292e8fca 100644 --- a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C +++ b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C @@ -290,22 +290,7 @@ template Foam::tmp Foam::heheuPsiThermo::Tb() const { - tmp tTb - ( - new volScalarField - ( - IOobject - ( - "Tb", - this->T_.time().timeName(), - this->T_.db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - this->T_ - ) - ); + tmp tTb(volScalarField::New("Tb", this->T_)); volScalarField& Tb_ = tTb.ref(); scalarField& TbCells = Tb_.primitiveFieldRef(); @@ -351,17 +336,9 @@ Foam::heheuPsiThermo::psiu() const { tmp tpsiu ( - new volScalarField + volScalarField::New ( - IOobject - ( - "psiu", - this->psi_.time().timeName(), - this->psi_.db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "psiu", this->psi_.mesh(), this->psi_.dimensions() ) @@ -405,17 +382,9 @@ Foam::heheuPsiThermo::psib() const { tmp tpsib ( - new volScalarField + volScalarField::New ( - IOobject - ( - "psib", - this->psi_.time().timeName(), - this->psi_.db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "psib", this->psi_.mesh(), this->psi_.dimensions() ) @@ -460,17 +429,9 @@ Foam::heheuPsiThermo::muu() const { tmp tmuu ( - new volScalarField + volScalarField::New ( - IOobject - ( - "muu", - this->T_.time().timeName(), - this->T_.db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "muu", this->T_.mesh(), dimensionSet(1, -1, -1, 0, 0) ) @@ -518,17 +479,9 @@ Foam::heheuPsiThermo::mub() const { tmp tmub ( - new volScalarField + volScalarField::New ( - IOobject - ( - "mub", - this->T_.time().timeName(), - this->T_.db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "mub", this->T_.mesh(), dimensionSet(1, -1, -1, 0, 0) ) diff --git a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C index 0ff54bdfff..1c682b16bc 100644 --- a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C +++ b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C @@ -630,17 +630,9 @@ Foam::pyrolysisChemistryModel::gasHs { tmp tHs ( - new volScalarField + volScalarField::New ( - IOobject - ( - "Hs_" + pyrolisisGases_[index], - this->mesh_.time().timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), + "Hs_" + pyrolisisGases_[index], this->mesh_, dimensionedScalar(dimEnergy/dimMass, 0) ) diff --git a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModelI.H b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModelI.H index 3cd5958e36..a5dbcc79a9 100644 --- a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModelI.H +++ b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModelI.H @@ -81,16 +81,9 @@ RRg() const { tmp tRRg ( - new volScalarField::Internal + volScalarField::Internal::New ( - IOobject - ( - "RRg", - this->time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "RRg", this->mesh(), dimensionedScalar(dimMass/dimVolume/dimTime, 0) ) diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.C b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.C index 3fef555ac7..3dcd349f88 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.C +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.C @@ -116,17 +116,9 @@ Foam::solidChemistryModel::Qdot() const { tmp tQdot ( - new volScalarField + volScalarField::New ( - IOobject - ( - "Qdot", - this->mesh_.time().timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::AUTO_WRITE, - false - ), + "Qdot", this->mesh_, dimensionedScalar(dimEnergy/dimVolume/dimTime, 0) ) diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModelI.H b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModelI.H index 8be36b8caa..a5a9644dff 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModelI.H +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModelI.H @@ -68,16 +68,9 @@ Foam::solidChemistryModel::RRs() const { tmp tRRs ( - new volScalarField::Internal + volScalarField::Internal::New ( - IOobject - ( - "RRs", - this->time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "RRs", this->mesh(), dimensionedScalar(dimMass/dimVolume/dimTime, 0) ) diff --git a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.C b/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.C index ec5cf2dd87..c943f048c2 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.C +++ b/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.C @@ -204,16 +204,9 @@ Foam::heSolidThermo::Kappa() const tmp tKappa ( - new volVectorField + volVectorField::New ( - IOobject - ( - "Kappa", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "Kappa", mesh, dimEnergy/dimTime/dimLength/dimTemperature )