physicalProperties: Generalise usage

This class is no longer pure virtual, and can be constructed for any
object registry. This means it can be used as a generic physical
properties dictionary, as well as being derived into more specific
contexts (i.e., finite-volume viscosity and thermodynamic models).
This commit is contained in:
Will Bainbridge
2024-04-04 11:01:19 +01:00
parent 3733a772f3
commit a1d6d552a3
3 changed files with 14 additions and 12 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "physicalProperties.H"
#include "fvMesh.H"
#include "objectRegistry.H"
#include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -102,11 +103,11 @@ Foam::IOobject Foam::physicalProperties::findModelDict
Foam::physicalProperties::physicalProperties
(
const fvMesh& mesh,
const objectRegistry& obr,
const word& group
)
:
IOdictionary(findModelDict(mesh, group, true))
IOdictionary(findModelDict(obr, group, true))
{
// Ensure name of IOdictionary is typeName
rename(IOobject::groupName(physicalProperties::typeName, group));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,7 @@ Class
Foam::physicalProperties
Description
An abstract base class for physical properties.
A base class for physical properties.
SourceFiles
physicalProperties.C
@ -42,9 +42,6 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
class fvMesh;
/*---------------------------------------------------------------------------*\
Class physicalProperties Declaration
\*---------------------------------------------------------------------------*/
@ -63,7 +60,7 @@ public:
// Constructors
//- Construct from components
physicalProperties(const fvMesh& mesh, const word& group);
physicalProperties(const objectRegistry& obr, const word& group);
//- Disallow default bitwise copy construction
physicalProperties(const physicalProperties&) = delete;
@ -76,6 +73,7 @@ public:
// Member Functions
//- Find the physicalProperties dictionary and return the IOobject
static IOobject findModelDict
(
const objectRegistry& obr,
@ -84,7 +82,7 @@ public:
);
//- Read physicalProperties dictionary
virtual bool read() = 0;
virtual bool read();
// Member Operators

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,6 +40,9 @@ Description
namespace Foam
{
// Forward declaration of classes
class fvMesh;
/*---------------------------------------------------------------------------*\
Class PhysicalPropertiesThermo Declaration
\*---------------------------------------------------------------------------*/