diff --git a/src/thermophysicalModels/radiation/radiationModels/P1/P1.C b/src/thermophysicalModels/radiation/radiationModels/P1/P1.C index 1e4de417bf2dc3bf9ec75dde4b859ab4d69b463e..d4336dd3c7640bed79203fe3b267a6c009b01d5f 100644 --- a/src/thermophysicalModels/radiation/radiationModels/P1/P1.C +++ b/src/thermophysicalModels/radiation/radiationModels/P1/P1.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -142,7 +142,7 @@ Foam::radiation::P1::P1(const dictionary& dict, const volScalarField& T) "qr", mesh_.time().timeName(), mesh_, - IOobject::NO_READ, + IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), mesh_, @@ -190,12 +190,6 @@ Foam::radiation::P1::P1(const dictionary& dict, const volScalarField& T) {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::radiation::P1::~P1() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::radiation::P1::read() @@ -240,19 +234,19 @@ void Foam::radiation::P1::calculate() fvm::laplacian(gamma, G_) - fvm::Sp(a_, G_) == - - 4.0*(e_*physicoChemical::sigma*pow4(T_) ) - E_ + - 4.0*(e_*physicoChemical::sigma*pow4(T_)) - E_ ); + // Calculate radiative heat flux on boundaries. volScalarField::Boundary& qrBf = qr_.boundaryFieldRef(); + const volScalarField::Boundary& GBf = G_.boundaryField(); + const volScalarField::Boundary& gammaBf = gamma.boundaryField(); - // Calculate radiative heat flux on boundaries. forAll(mesh_.boundaryMesh(), patchi) { - if (!G_.boundaryField()[patchi].coupled()) + if (!GBf[patchi].coupled()) { - qrBf[patchi] = - -gamma.boundaryField()[patchi] - *G_.boundaryField()[patchi].snGrad(); + qrBf[patchi] = -gammaBf[patchi]*GBf[patchi].snGrad(); } } } @@ -282,12 +276,9 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::P1::Rp() const Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>> Foam::radiation::P1::Ru() const { - const volScalarField::Internal& G = - G_(); - const volScalarField::Internal E = - absorptionEmission_->ECont()()(); - const volScalarField::Internal a = - absorptionEmission_->aCont()()(); + const volScalarField::Internal& G = G_(); + const volScalarField::Internal E = absorptionEmission_->ECont()()(); + const volScalarField::Internal a = absorptionEmission_->aCont()()(); return a*G - E; } @@ -298,4 +289,5 @@ Foam::label Foam::radiation::P1::nBands() const return absorptionEmission_->nBands(); } + // ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModels/P1/P1.H b/src/thermophysicalModels/radiation/radiationModels/P1/P1.H index 4b8a724434ba769c6895363a54321d5f2639c03d..b1daa691663412f89963653a56f43f353cdf2214 100644 --- a/src/thermophysicalModels/radiation/radiationModels/P1/P1.H +++ b/src/thermophysicalModels/radiation/radiationModels/P1/P1.H @@ -107,7 +107,7 @@ public: //- Destructor - virtual ~P1(); + virtual ~P1() = default; // Member functions