diff --git a/src/thermophysicalModels/radiation/radiationModel/P1/P1.C b/src/thermophysicalModels/radiation/radiationModel/P1/P1.C index 1afa7a6f0..2cc76c07b 100644 --- a/src/thermophysicalModels/radiation/radiationModel/P1/P1.C +++ b/src/thermophysicalModels/radiation/radiationModel/P1/P1.C @@ -39,13 +39,7 @@ namespace Foam namespace radiation { defineTypeNameAndDebug(P1, 0); - - addToRunTimeSelectionTable - ( - radiationModel, - P1, - dictionary - ); + addToRadiationRunTimeSelectionTables(P1); } } @@ -122,6 +116,76 @@ Foam::radiation::P1::P1(const volScalarField& T) {} +Foam::radiation::P1::P1(const dictionary& dict, const volScalarField& T) +: + radiationModel(typeName, dict, T), + G_ + ( + IOobject + ( + "G", + mesh_.time().timeName(), + T.db(), + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + Qr_ + ( + IOobject + ( + "Qr", + mesh_.time().timeName(), + T.db(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("Qr", dimMass/pow3(dimTime), 0.0) + ), + a_ + ( + IOobject + ( + "a", + mesh_.time().timeName(), + T.db(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("a", dimless/dimLength, 0.0) + ), + e_ + ( + IOobject + ( + "e", + mesh_.time().timeName(), + T.db(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("a", dimless/dimLength, 0.0) + ), + E_ + ( + IOobject + ( + "E", + mesh_.time().timeName(), + T.db(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("E", dimMass/dimLength/pow3(dimTime), 0.0) + ) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::radiation::P1::~P1() @@ -150,7 +214,9 @@ void Foam::radiation::P1::calculate() a_ = absorptionEmission_->a(); e_ = absorptionEmission_->e(); E_ = absorptionEmission_->E(); - const volScalarField sigmaEff = scatter_->sigmaEff(); + const volScalarField sigmaEff(scatter_->sigmaEff()); + + const dimensionedScalar a0 ("a0", a_.dimensions(), ROOTVSMALL); // Construct diffusion const volScalarField gamma @@ -163,7 +229,7 @@ void Foam::radiation::P1::calculate() IOobject::NO_READ, IOobject::NO_WRITE ), - 1.0/(3.0*a_ + sigmaEff) + 1.0/(3.0*a_ + sigmaEff + a0) ); // Solve G transport equation @@ -210,10 +276,8 @@ Foam::radiation::P1::Ru() const { const DimensionedField& G = G_.dimensionedInternalField(); - const DimensionedField E = absorptionEmission_->ECont()().dimensionedInternalField(); - const DimensionedField a = absorptionEmission_->aCont()().dimensionedInternalField(); diff --git a/src/thermophysicalModels/radiation/radiationModel/P1/P1.H b/src/thermophysicalModels/radiation/radiationModel/P1/P1.H index 5eeffb6ec..73321e92c 100644 --- a/src/thermophysicalModels/radiation/radiationModel/P1/P1.H +++ b/src/thermophysicalModels/radiation/radiationModel/P1/P1.H @@ -96,6 +96,8 @@ public: //- Construct from components P1(const volScalarField& T); + //- Construct from components + P1(const dictionary& dict, const volScalarField& T); // Destructor virtual ~P1(); diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C index 880383e38..e856a3f5c 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C @@ -38,62 +38,14 @@ namespace Foam namespace radiation { defineTypeNameAndDebug(fvDOM, 0); - - addToRunTimeSelectionTable - ( - radiationModel, - fvDOM, - dictionary - ); + addToRadiationRunTimeSelectionTables(fvDOM); } } -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -Foam::radiation::fvDOM::fvDOM(const volScalarField& T) -: - radiationModel(typeName, T), - G_ - ( - IOobject - ( - "G", - mesh().time().timeName(), - T.db(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - mesh(), - dimensionedScalar("G", dimMass/pow3(dimTime), 0.0) - ), - a_ - ( - IOobject - ( - "a", - mesh().time().timeName(), - T.db(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - mesh(), - dimensionedScalar("a", dimless/dimLength, 0.0) - ), - nTheta_(readLabel(coeffs_.lookup("nTheta"))), - nPhi_(readLabel(coeffs_.lookup("nPhi"))), - nRay_(0), - nLambda_(absorptionEmission_->nBands()), - aLambda_(nLambda_), - blackBody_(nLambda_, T), - IRay_(0), - Qem_(nLambda_), - Qin_(nLambda_), - convergence_(coeffs_.lookupOrDefault("convergence", 0.0)), - maxIter_(coeffs_.lookupOrDefault