mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: regionFaModel: various updates
This commit is contained in:
@ -41,6 +41,9 @@ namespace regionModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Foam::word
|
||||||
|
Foam::regionModels::regionFaModel::regionFaModelName("regionFaModel");
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::regionModels::regionFaModel::constructMeshObjects()
|
void Foam::regionModels::regionFaModel::constructMeshObjects()
|
||||||
@ -60,12 +63,31 @@ void Foam::regionModels::regionFaModel::initialise()
|
|||||||
}
|
}
|
||||||
|
|
||||||
vsmPtr_.reset(new volSurfaceMapping(regionMeshPtr_()));
|
vsmPtr_.reset(new volSurfaceMapping(regionMeshPtr_()));
|
||||||
|
|
||||||
|
if (!outputPropertiesPtr_)
|
||||||
|
{
|
||||||
|
const fileName uniformPath(word("uniform")/regionFaModelName);
|
||||||
|
|
||||||
|
outputPropertiesPtr_.reset
|
||||||
|
(
|
||||||
|
new IOdictionary
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
regionName_ + "OutputProperties",
|
||||||
|
time_.timeName(),
|
||||||
|
uniformPath/regionName_,
|
||||||
|
primaryMesh_,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
bool Foam::regionModels::regionFaModel::init(const dictionary& dict)
|
||||||
|
|
||||||
bool Foam::regionModels::regionFaModel::read(const dictionary& dict)
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -102,6 +124,17 @@ Foam::regionModels::regionFaModel::regionFaModel
|
|||||||
bool readFields
|
bool readFields
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
IOdictionary
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName(regionFaModelName, patch.name()),
|
||||||
|
patch.boundaryMesh().mesh().time().constant(),
|
||||||
|
patch.boundaryMesh().mesh().time(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
),
|
||||||
primaryMesh_(patch.boundaryMesh().mesh()),
|
primaryMesh_(patch.boundaryMesh().mesh()),
|
||||||
patch_(patch),
|
patch_(patch),
|
||||||
time_(patch.boundaryMesh().mesh().time()),
|
time_(patch.boundaryMesh().mesh().time()),
|
||||||
@ -110,19 +143,17 @@ Foam::regionModels::regionFaModel::regionFaModel
|
|||||||
modelName_(modelName),
|
modelName_(modelName),
|
||||||
regionMeshPtr_(nullptr),
|
regionMeshPtr_(nullptr),
|
||||||
coeffs_(dict.subOrEmptyDict(modelName + "Coeffs")),
|
coeffs_(dict.subOrEmptyDict(modelName + "Coeffs")),
|
||||||
|
outputPropertiesPtr_(nullptr),
|
||||||
vsmPtr_(nullptr),
|
vsmPtr_(nullptr),
|
||||||
patchID_(patch.index()),
|
patchID_(patch.index()),
|
||||||
regionName_(dict.lookup("region"))
|
regionName_(dict.lookup("region"))
|
||||||
{
|
{
|
||||||
if (active_)
|
|
||||||
{
|
|
||||||
constructMeshObjects();
|
constructMeshObjects();
|
||||||
initialise();
|
initialise();
|
||||||
|
|
||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
read(dict);
|
init(dict);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,8 +196,9 @@ void Foam::regionModels::regionFaModel::postEvolveRegion()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
void Foam::regionModels::regionFaModel::info()
|
Foam::scalar Foam::regionModels::regionFaModel::CourantNumber() const
|
||||||
{}
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -88,6 +88,8 @@ namespace regionModels
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class regionFaModel
|
class regionFaModel
|
||||||
|
:
|
||||||
|
public IOdictionary
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -97,6 +99,9 @@ class regionFaModel
|
|||||||
//- Initialise the region
|
//- Initialise the region
|
||||||
void initialise();
|
void initialise();
|
||||||
|
|
||||||
|
//- Read control parameters from dictionary
|
||||||
|
bool init(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -126,6 +131,9 @@ protected:
|
|||||||
//- Model coefficients dictionary
|
//- Model coefficients dictionary
|
||||||
dictionary coeffs_;
|
dictionary coeffs_;
|
||||||
|
|
||||||
|
//- Dictionary of output properties
|
||||||
|
autoPtr<IOdictionary> outputPropertiesPtr_;
|
||||||
|
|
||||||
//-Volume-to surface mapping
|
//-Volume-to surface mapping
|
||||||
autoPtr<volSurfaceMapping> vsmPtr_;
|
autoPtr<volSurfaceMapping> vsmPtr_;
|
||||||
|
|
||||||
@ -140,18 +148,15 @@ protected:
|
|||||||
word regionName_;
|
word regionName_;
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
|
||||||
|
|
||||||
//- Read control parameters from dictionary
|
|
||||||
virtual bool read(const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("regionFaModel");
|
TypeName("regionFaModel");
|
||||||
|
|
||||||
|
|
||||||
|
//- Default name regionFaModel
|
||||||
|
static const word regionFaModelName;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from mesh and name and dict
|
//- Construct from mesh and name and dict
|
||||||
@ -203,20 +208,25 @@ public:
|
|||||||
//- Return the model coefficients dictionary
|
//- Return the model coefficients dictionary
|
||||||
inline const dictionary& coeffs() const;
|
inline const dictionary& coeffs() const;
|
||||||
|
|
||||||
|
//- Return const access to the output properties dictionary
|
||||||
|
inline const IOdictionary& outputProperties() const;
|
||||||
|
|
||||||
|
//- Return output properties dictionary
|
||||||
|
inline IOdictionary& outputProperties();
|
||||||
|
|
||||||
//- Return the solution dictionary
|
//- Return the solution dictionary
|
||||||
inline const dictionary& solution() const;
|
inline const dictionary& solution() const;
|
||||||
|
|
||||||
//- Return volSurfaceMapping
|
//- Return patch ID
|
||||||
|
inline label patchID() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Help Functions
|
||||||
|
|
||||||
|
//- Return mapping between surface and volume fields
|
||||||
const volSurfaceMapping& vsm() const;
|
const volSurfaceMapping& vsm() const;
|
||||||
|
|
||||||
|
|
||||||
// Addressing
|
|
||||||
|
|
||||||
//- Return the list of patch IDs on the primary region coupled
|
|
||||||
//- to this region
|
|
||||||
inline label patchID();
|
|
||||||
|
|
||||||
|
|
||||||
// Evolution
|
// Evolution
|
||||||
|
|
||||||
//- Main driver routing to evolve the region - calls other evolves
|
//- Main driver routing to evolve the region - calls other evolves
|
||||||
@ -231,11 +241,14 @@ public:
|
|||||||
//- Post-evolve region
|
//- Post-evolve region
|
||||||
virtual void postEvolveRegion();
|
virtual void postEvolveRegion();
|
||||||
|
|
||||||
|
//- Courant number of the region
|
||||||
|
virtual scalar CourantNumber() const;
|
||||||
|
|
||||||
|
|
||||||
// IO
|
// IO
|
||||||
|
|
||||||
//- Provide some feedback
|
//- Provide some feedback
|
||||||
virtual void info();
|
virtual void info() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -101,6 +101,32 @@ inline const Foam::dictionary& Foam::regionModels::regionFaModel::coeffs() const
|
|||||||
return coeffs_;
|
return coeffs_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const Foam::IOdictionary&
|
||||||
|
Foam::regionModels::regionFaModel::outputProperties() const
|
||||||
|
{
|
||||||
|
if (!outputPropertiesPtr_)
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "outputProperties dictionary not available"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
return *outputPropertiesPtr_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::IOdictionary&
|
||||||
|
Foam::regionModels::regionFaModel::outputProperties()
|
||||||
|
{
|
||||||
|
if (!outputPropertiesPtr_)
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "outputProperties dictionary not available"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return *outputPropertiesPtr_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::dictionary&
|
inline const Foam::dictionary&
|
||||||
Foam::regionModels::regionFaModel::solution() const
|
Foam::regionModels::regionFaModel::solution() const
|
||||||
@ -109,7 +135,7 @@ Foam::regionModels::regionFaModel::solution() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::label Foam::regionModels::regionFaModel::patchID()
|
inline Foam::label Foam::regionModels::regionFaModel::patchID() const
|
||||||
{
|
{
|
||||||
return patchID_;
|
return patchID_;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user