From f84c4ba8a2eb7686cded5bc25ea7f70d683c9bf5 Mon Sep 17 00:00:00 2001 From: Andrew Heather <a.heather@opencfd.co.uk> Date: Tue, 26 Apr 2016 14:35:01 +0100 Subject: [PATCH] BUG: boundaryRadiationProperties - updated to use caseConstant() for parallel usage and updated style --- .../boundaryRadiationProperties.C | 57 ++++++++++++------- .../boundaryRadiationProperties.H | 7 +-- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C index 709c03a7788..0973c19fd6d 100644 --- a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C +++ b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.C @@ -42,13 +42,14 @@ namespace Foam Foam::IOobject Foam::radiation::boundaryRadiationProperties::createIOobject ( - const fvMesh& mesh, const word name + const fvMesh& mesh, + const word name ) const { IOobject io ( name, - mesh.time().constant(), + mesh.time().caseConstant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE @@ -71,7 +72,7 @@ Foam::IOobject Foam::radiation::boundaryRadiationProperties::createIOobject Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties ( - const fvMesh& mesh + const fvMesh& mesh ) : MeshObject @@ -99,15 +100,19 @@ Foam::radiation::boundaryRadiationProperties::boundaryRadiationProperties // * * * * * * * * * * * * * * * Member fucntions * * * * * * * * * * * * * // -const Foam::volScalarField& Foam::radiation::boundaryRadiationProperties:: -radBoundaryProperties() const +const Foam::volScalarField& +Foam::radiation::boundaryRadiationProperties::radBoundaryProperties() const { return radBoundaryProperties_(); } -Foam::tmp<Foam::scalarField> Foam::radiation::boundaryRadiationProperties:: -emissivity(const label index, const label bandI) const +Foam::tmp<Foam::scalarField> +Foam::radiation::boundaryRadiationProperties::emissivity +( + const label index, + const label bandI +) const { if (!radBoundaryProperties_.empty()) { @@ -120,8 +125,8 @@ emissivity(const label index, const label bandI) const { FatalErrorInFunction << "Field 'boundaryRadiationProperties'" - << "is not found in the constant directory." - << "Please add it " + << "is not found in the constant directory. " + << "Please add it" << exit(FatalError); return tmp<scalarField>(new scalarField()); @@ -129,8 +134,12 @@ emissivity(const label index, const label bandI) const } -Foam::tmp<Foam::scalarField> Foam::radiation::boundaryRadiationProperties:: -absorptivity(const label index, const label bandI) const +Foam::tmp<Foam::scalarField> +Foam::radiation::boundaryRadiationProperties::absorptivity +( + const label index, + const label bandI +) const { if (!radBoundaryProperties_.empty()) { @@ -143,7 +152,7 @@ absorptivity(const label index, const label bandI) const { FatalErrorInFunction << "Field 'boundaryRadiationProperties'" - << "is not found in the constant directory." + << "is not found in the constant directory. " << "Please add it " << exit(FatalError); @@ -152,8 +161,12 @@ absorptivity(const label index, const label bandI) const } -Foam::tmp<Foam::scalarField> Foam::radiation::boundaryRadiationProperties:: -transmissivity(const label index, const label bandI) const +Foam::tmp<Foam::scalarField> +Foam::radiation::boundaryRadiationProperties::transmissivity +( + const label index, + const label bandI +) const { if (!radBoundaryProperties_.empty()) { @@ -166,8 +179,8 @@ transmissivity(const label index, const label bandI) const { FatalErrorInFunction << "Field 'boundaryRadiationProperties'" - << "is not found in the constant directory." - << "Please add it " + << "is not found in the constant directory. " + << "Please add it" << exit(FatalError); return tmp<scalarField>(new scalarField()); @@ -175,8 +188,12 @@ transmissivity(const label index, const label bandI) const } -Foam::tmp<Foam::scalarField> Foam::radiation::boundaryRadiationProperties:: -reflectivity(const label index, const label bandI) const +Foam::tmp<Foam::scalarField> +Foam::radiation::boundaryRadiationProperties::reflectivity +( + const label index, + const label bandI +) const { if (!radBoundaryProperties_.empty()) { @@ -189,8 +206,8 @@ reflectivity(const label index, const label bandI) const { FatalErrorInFunction << "Field 'boundaryRadiationProperties'" - << "is not found in the constant directory." - << "Please add it " + << "is not found in the constant directory. " + << "Please add it" << exit(FatalError); return tmp<scalarField>(new scalarField()); diff --git a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.H b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.H index 0bb1cc4d8d5..32b236592d6 100644 --- a/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.H +++ b/src/thermophysicalModels/radiation/submodels/boundaryRadiationProperties/boundaryRadiationProperties.H @@ -22,12 +22,11 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::fv::boundaryRadiationProperties + Foam::radiation::boundaryRadiationProperties Description Boundary radiation properties holder - SourceFiles boundaryRadiationProperties.C @@ -84,7 +83,7 @@ public: // Constructors - //- Construct given fvMesh and IOobject + //- Construct given fvMesh boundaryRadiationProperties(const fvMesh&); @@ -127,9 +126,9 @@ public: //- Destructor virtual ~boundaryRadiationProperties(); - }; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace radiation -- GitLab