Commit 4678638a authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'region-model-mesh' into 'develop'

Enabled postProcess on film region for reactingParcelFoam

See merge request !352
parents 179d9fd6 af34e61e
#include "createMesh.H"
IOdictionary filmDict
(
IOobject
(
"surfaceFilmProperties",
runTime.constant(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
const word filmRegionName = filmDict.get<word>("region");
fvMesh filmMesh
(
IOobject
(
filmRegionName,
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
);
......@@ -70,6 +70,7 @@ int main(int argc, char *argv[])
" and surface film modelling."
);
#define CREATE_MESH createMeshesPostProcess.H
#include "postProcess.H"
#include "addCheckCaseOptions.H"
......
......@@ -46,11 +46,9 @@ namespace regionModels
void Foam::regionModels::regionModel::constructMeshObjects()
{
// construct region mesh
if (!time_.foundObject<fvMesh>(regionName_))
{
regionMeshPtr_.reset
(
fvMesh* regionMeshPtr =
new fvMesh
(
IOobject
......@@ -60,8 +58,9 @@ void Foam::regionModels::regionModel::constructMeshObjects()
time_,
IOobject::MUST_READ
)
)
);
);
regionMeshPtr->objectRegistry::store();
}
}
......@@ -364,7 +363,6 @@ Foam::regionModels::regionModel::regionModel
active_(false),
infoOutput_(false),
modelName_("none"),
regionMeshPtr_(nullptr),
coeffs_(dictionary::null),
outputPropertiesPtr_(nullptr),
primaryPatchIDs_(),
......@@ -400,7 +398,6 @@ Foam::regionModels::regionModel::regionModel
active_(get<Switch>("active")),
infoOutput_(true),
modelName_(modelName),
regionMeshPtr_(nullptr),
coeffs_(subOrEmptyDict(modelName + "Coeffs")),
outputPropertiesPtr_(nullptr),
primaryPatchIDs_(),
......@@ -448,7 +445,6 @@ Foam::regionModels::regionModel::regionModel
active_(dict.get<Switch>("active")),
infoOutput_(false),
modelName_(modelName),
regionMeshPtr_(nullptr),
coeffs_(dict.subOrEmptyDict(modelName + "Coeffs")),
outputPropertiesPtr_(nullptr),
primaryPatchIDs_(),
......@@ -469,12 +465,6 @@ Foam::regionModels::regionModel::regionModel
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionModels::regionModel::~regionModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::regionModels::regionModel::evolve()
......
......@@ -99,9 +99,6 @@ protected:
//- Model name
const word modelName_;
//- Pointer to the region mesh database
autoPtr<fvMesh> regionMeshPtr_;
//- Model coefficients dictionary
dictionary coeffs_;
......@@ -185,7 +182,7 @@ public:
//- Destructor
virtual ~regionModel();
virtual ~regionModel() = default;
// Member Functions
......
......@@ -62,19 +62,15 @@ inline const Foam::word& Foam::regionModels::regionModel::modelName() const
inline const Foam::fvMesh& Foam::regionModels::regionModel::regionMesh() const
{
const fvMesh* regionPtr = time_.findObject<fvMesh>(regionName_);
const fvMesh* regionPtr = time_.getObjectPtr<fvMesh>(regionName_);
if (regionPtr)
{
return *regionPtr;
}
else if (!regionMeshPtr_.valid())
if (!regionPtr)
{
FatalErrorInFunction
<< "Region mesh not available" << abort(FatalError);
}
return *regionMeshPtr_;
return *regionPtr;
}
......@@ -82,17 +78,13 @@ inline Foam::fvMesh& Foam::regionModels::regionModel::regionMesh()
{
fvMesh* regionPtr = time_.getObjectPtr<fvMesh>(regionName_);
if (regionPtr)
{
return *regionPtr;
}
else if (!regionMeshPtr_.valid())
if (!regionPtr)
{
FatalErrorInFunction
<< "Region mesh not available" << abort(FatalError);
}
return *regionMeshPtr_;
return *regionPtr;
}
......
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