diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/GreyDiffusiveRadiation/GreyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C similarity index 69% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/GreyDiffusiveRadiation/GreyDiffusiveRadiationMixedFvPatchScalarField.C rename to src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index 818b874d1d..93d64a1cbd 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/GreyDiffusiveRadiation/GreyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "GreyDiffusiveRadiationMixedFvPatchScalarField.H" +#include "greyDiffusiveRadiationMixedFvPatchScalarField.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" @@ -37,15 +37,15 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField:: -GreyDiffusiveRadiationMixedFvPatchField +Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField:: +greyDiffusiveRadiationMixedFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF ) : mixedFvPatchScalarField(p, iF), - TName_("undefined"), + TName_("undefinedT"), emissivity_(0.0), myRayIndex_(0), myWaveLengthIndex_(0), @@ -59,10 +59,10 @@ GreyDiffusiveRadiationMixedFvPatchField } -Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField:: -GreyDiffusiveRadiationMixedFvPatchField +Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField:: +greyDiffusiveRadiationMixedFvPatchScalarField ( - const GreyDiffusiveRadiationMixedFvPatchField& ptf, + const greyDiffusiveRadiationMixedFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper @@ -78,8 +78,8 @@ GreyDiffusiveRadiationMixedFvPatchField {} -Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField:: -GreyDiffusiveRadiationMixedFvPatchField +Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField:: +greyDiffusiveRadiationMixedFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, @@ -117,10 +117,10 @@ GreyDiffusiveRadiationMixedFvPatchField } -Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField:: -GreyDiffusiveRadiationMixedFvPatchField +Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField:: +greyDiffusiveRadiationMixedFvPatchScalarField ( - const GreyDiffusiveRadiationMixedFvPatchField& ptf + const greyDiffusiveRadiationMixedFvPatchScalarField& ptf ) : mixedFvPatchScalarField(ptf), @@ -133,10 +133,10 @@ GreyDiffusiveRadiationMixedFvPatchField {} -Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField:: -GreyDiffusiveRadiationMixedFvPatchField +Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField:: +greyDiffusiveRadiationMixedFvPatchScalarField ( - const GreyDiffusiveRadiationMixedFvPatchField& ptf, + const greyDiffusiveRadiationMixedFvPatchScalarField& ptf, const DimensionedField& iF ) : @@ -153,17 +153,18 @@ GreyDiffusiveRadiationMixedFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::autoMap +void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::autoMap ( const fvPatchFieldMapper& m ) { scalarField::autoMap(m); + qr_.automap(m); } -void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::rmap +void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::rmap ( const fvPatchScalarField& ptf, const labelList& addr @@ -171,12 +172,15 @@ void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::rmap { mixedFvPatchScalarField::rmap(ptf, addr); -// const GreyDiffusiveRadiationMixedFvPatchField& mrptf = - refCast(ptf); + const greyDiffusiveRadiationMixedFvPatchScalarField& gdrpsf = + refCast(ptf); + + qr_.rmap(gdrpsf.qr_, addr); } -void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::updateCoeffs() +void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField:: +updateCoeffs() { if (this->updated()) { @@ -187,28 +191,31 @@ void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::updateCoeffs() patch().lookupPatchField(TName_); const radiationModel& rad = - db().lookupObject("radiationProperties"); + db().lookupObject("radiationProperties"); - const fvDOM& Dom(refCast(rad)); + const fvDOM& dom = refCast(rad); const label patchi = patch().index(); - if(Dom.lambdaj() == 1) + if (dom.lambdaj() == 1) { if (myRayIsInit_ == -1) { - for(label i=0; i < Dom.Ni() ; i++) + for (label i=0; i < Dom.Ni() ; i++) { - for(label j=0; j < Dom.lambdaj() ; j++) + for (label j=0; j < dom.lambdaj() ; j++) { const volScalarField& radiationField = - Dom.RadIntRayiLambdaj(i,j); - if (&(radiationField.internalField()) == - &dimensionedInternalField()) + dom.RadIntRayiLambdaj(i,j); + if + ( + &(radiationField.internalField()) + == &dimensionedInternalField() + ) { myRayIndex_ = i; myWaveLengthIndex_ = j; - myRayIsInit_ = 0.; + myRayIsInit_ = 0.0; break; } } @@ -220,7 +227,7 @@ void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::updateCoeffs() FatalErrorIn ( "Foam::radiation::" - "GreyDiffusiveRadiationMixedFvPatchField::" + "greyDiffusiveRadiationMixedFvPatchScalarField::" "updateCoeffs" ) << " a grey boundary condition is used with a non-grey" << "absorption model" @@ -229,22 +236,21 @@ void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::updateCoeffs() vectorField n = patch().Sf()/patch().magSf(); - scalarField& Iw = *(this); + scalarField& Iw = *this; - qr_ = Iw *(-n & Dom.RadIntRay(myRayIndex_).Di()); + qr_ = Iw*(-n & dom.RadIntRay(myRayIndex_).Di()); - Dom.RadIntRay(myRayIndex_).add(qr_,patchi); + dom.RadIntRay(myRayIndex_).add(qr_,patchi); forAll(Iw, faceI) { - scalar Ir = 0.0; - for(label i=0; i < Dom.Ni() ; i++) // + for (label i=0; i < dom.Ni(); i++) { - const vector& si = Dom.RadIntRay(i).Si(); + const vector& si = dom.RadIntRay(i).Si(); - const scalarField& Iface = Dom.RadIntRay(i).Ilambdaj + const scalarField& Iface = dom.RadIntRay(i).Ilambdaj ( myWaveLengthIndex_ ).boundaryField()[patch().index()]; @@ -253,12 +259,12 @@ void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::updateCoeffs() if (InOut < 0.) // qin into the wall { - const vector& di = Dom.RadIntRay(i).Di(); + const vector& di = dom.RadIntRay(i).Di(); Ir += Iface[faceI]*mag(n[faceI] & di); } } - const vector& mySi = Dom.RadIntRay(myRayIndex_).Si(); + const vector& mySi = dom.RadIntRay(myRayIndex_).Si(); scalar InOut = -n[faceI] & mySi; @@ -266,9 +272,12 @@ void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::updateCoeffs() { refGrad()[faceI] = 0.0; valueFraction()[faceI] = 1.0; - refValue()[faceI] = ((1. - emissivity_) * Ir + - emissivity_*radiation::sigmaSB.value()*pow4(Tp[faceI])) / - Foam::mathematicalConstant::pi; + refValue()[faceI] = + ( + Ir*(1.0 - emissivity_) + + emissivity_*radiation::sigmaSB.value()*pow4(Tp[faceI]) + ) + /mathematicalConstant::pi; } else if (InOut < 0.) //direction into the wall @@ -283,13 +292,14 @@ void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::updateCoeffs() } -void Foam::radiation::GreyDiffusiveRadiationMixedFvPatchField::write(Ostream& -os) const +void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::write +( + Ostream& os +) const { fvPatchScalarField::write(os); os.writeKeyword("T") << TName_ << token::END_STATEMENT << nl; os.writeKeyword("emissivity") << emissivity_ << token::END_STATEMENT << nl; - writeEntry("value", os); } @@ -303,7 +313,7 @@ namespace radiation makePatchTypeField ( fvPatchScalarField, - GreyDiffusiveRadiationMixedFvPatchField + greyDiffusiveRadiationMixedFvPatchScalarField ); } } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/WideBandDiffusiveRadiation/WideBandDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H similarity index 78% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/WideBandDiffusiveRadiation/WideBandDiffusiveRadiationMixedFvPatchScalarField.H rename to src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H index 765579c3ac..0c22d52caa 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/WideBandDiffusiveRadiation/WideBandDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H @@ -23,18 +23,18 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::WideBandDiffusiveRadiationMixedFvPatchField + Foam::greyDiffusiveRadiationMixedFvPatchScalarField Description Radiation temperature specified SourceFiles - WideBandDiffusiveRadiationMixedFvPatchField.C + greyDiffusiveRadiationMixedFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef WideBandDiffusiveRadiationMixedFvPatchField_H -#define WideBandDiffusiveRadiationMixedFvPatchField_H +#ifndef greyDiffusiveRadiationMixedFvPatchScalarField_H +#define greyDiffusiveRadiationMixedFvPatchScalarField_H #include "mixedFvPatchFields.H" @@ -45,14 +45,13 @@ namespace Foam namespace radiation { /*---------------------------------------------------------------------------*\ - Class WideBandDiffusiveRadiationMixedFvPatchField Declaration + Class greyDiffusiveRadiationMixedFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class WideBandDiffusiveRadiationMixedFvPatchField +class greyDiffusiveRadiationMixedFvPatchScalarField : public mixedFvPatchScalarField { - // Private data //- Name of temperature field @@ -67,49 +66,50 @@ class WideBandDiffusiveRadiationMixedFvPatchField //- Direction index label myWaveLengthIndex_; - //- Init ray flag + //- Initialise ray flag label myRayIsInit_; - //- Radiative heat flux on walls. + //- Radiative heat flux on walls scalarField qr_; + public: //- Runtime type information - TypeName("WideBandDiffusiveRadiation"); + TypeName("greyDiffusiveRadiation"); // Constructors //- Construct from patch and internal field - WideBandDiffusiveRadiationMixedFvPatchField + greyDiffusiveRadiationMixedFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - WideBandDiffusiveRadiationMixedFvPatchField + greyDiffusiveRadiationMixedFvPatchScalarField ( const fvPatch&, const DimensionedField&, const dictionary& ); - //- Construct by mapping given GreyDiffusiveRadiationMixedFvPatchField - // onto a new patch - WideBandDiffusiveRadiationMixedFvPatchField + //- Construct by mapping given a + // greyDiffusiveRadiationMixedFvPatchScalarField onto a new patch + greyDiffusiveRadiationMixedFvPatchScalarField ( - const WideBandDiffusiveRadiationMixedFvPatchField&, + const greyDiffusiveRadiationMixedFvPatchScalarField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - WideBandDiffusiveRadiationMixedFvPatchField + greyDiffusiveRadiationMixedFvPatchScalarField ( - const WideBandDiffusiveRadiationMixedFvPatchField& + const greyDiffusiveRadiationMixedFvPatchScalarField& ); //- Construct and return a clone @@ -117,14 +117,14 @@ public: { return tmp ( - new WideBandDiffusiveRadiationMixedFvPatchField(*this) + new greyDiffusiveRadiationMixedFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - WideBandDiffusiveRadiationMixedFvPatchField + greyDiffusiveRadiationMixedFvPatchScalarField ( - const WideBandDiffusiveRadiationMixedFvPatchField&, + const greyDiffusiveRadiationMixedFvPatchScalarField&, const DimensionedField& ); @@ -136,7 +136,7 @@ public: { return tmp ( - new WideBandDiffusiveRadiationMixedFvPatchField(*this, iF) + new greyDiffusiveRadiationMixedFvPatchScalarField(*this, iF) ); } @@ -145,13 +145,13 @@ public: // Access - //- Return the temperature field name + //- Return the temperature field name const word& TName() const { return TName_; } - //- Return reference to the temperature field name to allow + //- Return reference to the temperature field name to allow // adjustment word& TName() { @@ -170,14 +170,14 @@ public: return emissivity_; } - //- Return heat flux on the boundary const scalarField& qr() const { return qr_; } - // Mapping functions + + // Mapping functions //- Map (and resize as needed) from self given a mapping object virtual void autoMap diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/WideBandDiffusiveRadiation/WideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C similarity index 68% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/WideBandDiffusiveRadiation/WideBandDiffusiveRadiationMixedFvPatchScalarField.C rename to src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index ef795c5f52..a760ada47c 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/WideBandDiffusiveRadiation/WideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -35,11 +35,10 @@ License #include "radiationConstants.H" #include "mathematicalConstants.H" - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField:: -WideBandDiffusiveRadiationMixedFvPatchField +Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField:: +wideBandDiffusiveRadiationMixedFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF @@ -51,7 +50,7 @@ WideBandDiffusiveRadiationMixedFvPatchField myRayIndex_(0), myWaveLengthIndex_(0), myRayIsInit_(-1), - qr_(0) + qr_(p.size(), 0.0) { refValue() = 0.0; refGrad() = 0.0; @@ -60,10 +59,10 @@ WideBandDiffusiveRadiationMixedFvPatchField } -Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField:: -WideBandDiffusiveRadiationMixedFvPatchField +Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField:: +wideBandDiffusiveRadiationMixedFvPatchScalarField ( - const WideBandDiffusiveRadiationMixedFvPatchField& ptf, + const wideBandDiffusiveRadiationMixedFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper @@ -79,8 +78,8 @@ WideBandDiffusiveRadiationMixedFvPatchField {} -Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField:: -WideBandDiffusiveRadiationMixedFvPatchField +Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField:: +wideBandDiffusiveRadiationMixedFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, @@ -93,17 +92,16 @@ WideBandDiffusiveRadiationMixedFvPatchField myRayIndex_(0), myWaveLengthIndex_(0), myRayIsInit_(-1), - qr_(0) + qr_(p.size(), 0.0) { const scalarField& Tp = patch().lookupPatchField(TName_); - refValue() = emissivity_*4.0*radiation::sigmaSB.value()*pow4(Tp) / - Foam::mathematicalConstant::pi; + refValue() = + emissivity_*4.0*radiation::sigmaSB.value()*pow4(Tp) + /Foam::mathematicalConstant::pi; refGrad() = 0.0; - qr_.setSize(p.size()); - if (dict.found("value")) { fvPatchScalarField::operator= @@ -118,10 +116,10 @@ WideBandDiffusiveRadiationMixedFvPatchField } -Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField:: -WideBandDiffusiveRadiationMixedFvPatchField +Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField:: +wideBandDiffusiveRadiationMixedFvPatchScalarField ( - const WideBandDiffusiveRadiationMixedFvPatchField& ptf + const wideBandDiffusiveRadiationMixedFvPatchScalarField& ptf ) : mixedFvPatchScalarField(ptf), @@ -134,10 +132,10 @@ WideBandDiffusiveRadiationMixedFvPatchField {} -Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField:: -WideBandDiffusiveRadiationMixedFvPatchField +Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField:: +wideBandDiffusiveRadiationMixedFvPatchScalarField ( - const WideBandDiffusiveRadiationMixedFvPatchField& ptf, + const wideBandDiffusiveRadiationMixedFvPatchScalarField& ptf, const DimensionedField& iF ) : @@ -148,23 +146,23 @@ WideBandDiffusiveRadiationMixedFvPatchField myWaveLengthIndex_(ptf.myWaveLengthIndex_), myRayIsInit_(ptf.myRayIsInit_), qr_(ptf.qr_) - {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::autoMap +void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField::autoMap ( const fvPatchFieldMapper& m ) { scalarField::autoMap(m); + qr_.automap(m); } -void Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::rmap +void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField::rmap ( const fvPatchScalarField& ptf, const labelList& addr @@ -172,14 +170,15 @@ void Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::rmap { mixedFvPatchScalarField::rmap(ptf, addr); -// const GreyDiffusiveRadiationMixedFvPatchField& mrptf = - refCast(ptf); + const wideBandDiffusiveRadiationMixedFvPatchScalarField& wbdrpsf = + refCast(ptf); + + qr_.rmap(wbdrpsf.qr_, addr); } -void -Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::updateCoeffs -() +void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField:: +updateCoeffs() { if (this->updated()) { @@ -187,24 +186,27 @@ Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::updateCoeffs } const radiationModel& rad = - db().lookupObject("radiationProperties"); + db().lookupObject("radiationProperties"); - const fvDOM& Dom(refCast(rad)); + const fvDOM& dom(refCast(rad)); const label patchi = patch().index(); - if(Dom.lambdaj() > 1) + if (dom.lambdaj() > 1) { if (myRayIsInit_ == -1) { - for(label i=0; i < Dom.Ni() ; i++) + for (label i=0; i < dom.Ni() ; i++) { - for(label j=0; j < Dom.lambdaj() ; j++) + for (label j=0; j < dom.lambdaj() ; j++) { const volScalarField& radiationField = - Dom.RadIntRayiLambdaj(i,j); - if (&(radiationField.internalField()) == - &dimensionedInternalField()) + dom.RadIntRayiLambdaj(i,j); + if + ( + &(radiationField.internalField()) + ==&dimensionedInternalField() + ) { myRayIndex_ = i; myWaveLengthIndex_ = j; @@ -220,7 +222,7 @@ Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::updateCoeffs FatalErrorIn ( "Foam::radiation::" - "WideBandDiffusiveRadiationMixedFvPatchScalarField::" + "wideBandDiffusiveRadiationMixedFvPatchScalarField::" "updateCoeffs" ) << " a Non-grey boundary condition is used with a grey" << "absorption model" @@ -229,24 +231,23 @@ Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::updateCoeffs vectorField n = patch().Sf()/patch().magSf(); - scalarField& Iw = *(this); + scalarField& Iw = *this; - qr_ = Iw *(-n & Dom.RadIntRay(myRayIndex_).Di()); + qr_ = Iw*(-n & dom.RadIntRay(myRayIndex_).Di()); - Dom.RadIntRay(myRayIndex_).add(qr_,patchi); + dom.RadIntRay(myRayIndex_).add(qr_,patchi); const scalarField Eb = - Dom.blackBody().bj(myWaveLengthIndex_).boundaryField()[patchi]; + dom.blackBody().bj(myWaveLengthIndex_).boundaryField()[patchi]; forAll(Iw, faceI) { - scalar Ir = 0.0; - for(label i=0; i < Dom.Ni() ; i++) // + for(label i=0; i < dom.Ni(); i++) { - const vector& si = Dom.RadIntRay(i).Si(); + const vector& si = dom.RadIntRay(i).Si(); - const scalarField& Iface = Dom.RadIntRay(i).Ilambdaj + const scalarField& Iface = dom.RadIntRay(i).Ilambdaj ( myWaveLengthIndex_ ).boundaryField()[patch().index()]; @@ -255,13 +256,12 @@ Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::updateCoeffs if (InOut < 0.) // qin into the wall { - const vector& di = Dom.RadIntRay(i).Di(); + const vector& di = dom.RadIntRay(i).Di(); Ir = Ir + Iface[faceI]*mag(n[faceI] & di); } } - - const vector& mySi = Dom.RadIntRay(myRayIndex_).Si(); + const vector& mySi = dom.RadIntRay(myRayIndex_).Si(); scalar InOut = -n[faceI] & mySi; @@ -269,8 +269,12 @@ Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::updateCoeffs { refGrad()[faceI] = 0.0; valueFraction()[faceI] = 1.0; - refValue()[faceI] = ((1. - emissivity_) * Ir + - emissivity_* Eb[faceI]) / Foam::mathematicalConstant::pi; + refValue()[faceI] = + ( + Ir*(1.0 - emissivity_) + + emissivity_* Eb[faceI] + ) + /mathematicalConstant::pi; } else if (InOut < 0.) //direction into the wall { @@ -284,7 +288,7 @@ Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::updateCoeffs } -void Foam::radiation::WideBandDiffusiveRadiationMixedFvPatchField::write +void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField::write ( Ostream& os ) const @@ -305,7 +309,7 @@ namespace radiation makePatchTypeField ( fvPatchScalarField, - WideBandDiffusiveRadiationMixedFvPatchField + wideBandDiffusiveRadiationMixedFvPatchScalarField ); } } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/GreyDiffusiveRadiation/GreyDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H similarity index 80% rename from src/thermophysicalModels/radiation/derivedFvPatchFields/GreyDiffusiveRadiation/GreyDiffusiveRadiationMixedFvPatchScalarField.H rename to src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H index cc0cd34129..80f985b3b0 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/GreyDiffusiveRadiation/GreyDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H @@ -23,18 +23,18 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::GreyDiffusiveRadiationMixedFvPatchField + Foam::wideBandDiffusiveRadiationMixedFvPatchScalarField Description Radiation temperature specified SourceFiles - GreyDiffusiveRadiationMixedFvPatchField.C + wideBandDiffusiveRadiationMixedFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef GreyDiffusiveRadiationMixedFvPatchField_H -#define GreyDiffusiveRadiationMixedFvPatchField_H +#ifndef wideBandDiffusiveRadiationMixedFvPatchScalarField_H +#define wideBandDiffusiveRadiationMixedFvPatchScalarField_H #include "mixedFvPatchFields.H" @@ -45,14 +45,13 @@ namespace Foam namespace radiation { /*---------------------------------------------------------------------------*\ - Class GreyDiffusiveRadiationMixedFvPatchField Declaration + Class wideBandDiffusiveRadiationMixedFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class GreyDiffusiveRadiationMixedFvPatchField +class wideBandDiffusiveRadiationMixedFvPatchScalarField : public mixedFvPatchScalarField { - // Private data //- Name of temperature field @@ -73,23 +72,24 @@ class GreyDiffusiveRadiationMixedFvPatchField //- Radiative heat flux on walls. scalarField qr_; + public: //- Runtime type information - TypeName("GreyDiffusiveRadiation"); + TypeName("wideBandDiffusiveRadiation"); // Constructors //- Construct from patch and internal field - GreyDiffusiveRadiationMixedFvPatchField + wideBandDiffusiveRadiationMixedFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - GreyDiffusiveRadiationMixedFvPatchField + wideBandDiffusiveRadiationMixedFvPatchScalarField ( const fvPatch&, const DimensionedField&, @@ -98,18 +98,18 @@ public: //- Construct by mapping given GreyDiffusiveRadiationMixedFvPatchField // onto a new patch - GreyDiffusiveRadiationMixedFvPatchField + wideBandDiffusiveRadiationMixedFvPatchScalarField ( - const GreyDiffusiveRadiationMixedFvPatchField&, + const wideBandDiffusiveRadiationMixedFvPatchScalarField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - GreyDiffusiveRadiationMixedFvPatchField + wideBandDiffusiveRadiationMixedFvPatchScalarField ( - const GreyDiffusiveRadiationMixedFvPatchField& + const wideBandDiffusiveRadiationMixedFvPatchScalarField& ); //- Construct and return a clone @@ -117,14 +117,14 @@ public: { return tmp ( - new GreyDiffusiveRadiationMixedFvPatchField(*this) + new wideBandDiffusiveRadiationMixedFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - GreyDiffusiveRadiationMixedFvPatchField + wideBandDiffusiveRadiationMixedFvPatchScalarField ( - const GreyDiffusiveRadiationMixedFvPatchField&, + const wideBandDiffusiveRadiationMixedFvPatchScalarField&, const DimensionedField& ); @@ -136,7 +136,7 @@ public: { return tmp ( - new GreyDiffusiveRadiationMixedFvPatchField(*this, iF) + new wideBandDiffusiveRadiationMixedFvPatchScalarField(*this, iF) ); } @@ -145,13 +145,13 @@ public: // Access - //- Return the temperature field name + //- Return the temperature field name const word& TName() const { return TName_; } - //- Return reference to the temperature field name to allow + //- Return reference to the temperature field name to allow // adjustment word& TName() { @@ -170,14 +170,14 @@ public: return emissivity_; } - //- Return heat flux on the boundary const scalarField& qr() const { return qr_; } - // Mapping functions + + // Mapping functions //- Map (and resize as needed) from self given a mapping object virtual void autoMap diff --git a/src/thermophysicalModels/radiation/radiationModel/P1/P1.H b/src/thermophysicalModels/radiation/radiationModel/P1/P1.H index d262330f63..b436a8509f 100644 --- a/src/thermophysicalModels/radiation/radiationModel/P1/P1.H +++ b/src/thermophysicalModels/radiation/radiationModel/P1/P1.H @@ -101,8 +101,7 @@ public: // Destructor - - ~P1(); + virtual ~P1(); // Member functions diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C index cf5958aa80..45a69f7a83 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C @@ -27,14 +27,8 @@ License #include "absorptionCoeffs.H" #include "IOstreams.H" -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // - -Foam::radiation::absorptionCoeffs::~absorptionCoeffs() -{} - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - Foam::radiation::absorptionCoeffs::absorptionCoeffs(Istream& is) : Tcommon_(readScalar(is)), @@ -42,38 +36,36 @@ Foam::radiation::absorptionCoeffs::absorptionCoeffs(Istream& is) Thigh_(readScalar(is)), invTemp_(readBool(is)) { - for - ( - label coefLabel=0; - absorptionCoeffs::nCoeffs_; - coefLabel++ - ) + for (label coefLabel=0; absorptionCoeffs::nCoeffs_; coefLabel++) { is >> highACoeffs_[coefLabel]; } - for - ( - label coefLabel=0; - absorptionCoeffs::nCoeffs_; - coefLabel++ - ) + for (label coefLabel=0; absorptionCoeffs::nCoeffs_; coefLabel++) { is >> lowACoeffs_[coefLabel]; } } + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // + +Foam::radiation::absorptionCoeffs::~absorptionCoeffs() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + void Foam::radiation::absorptionCoeffs::checkT(const scalar T) const { - if (T < Tlow_ || T > Thigh_) + if (T < Tlow_ || T > Thigh_) { FatalErrorIn ( - "absCoeffs::checkT(const scalar T) const" - ) << "attempt to use absCoeff" - " out of temperature range " - << Tlow_ << " -> " << Thigh_ << "; T = " << T - << abort(FatalError); + "absorptionCoeffs::checkT(const scalar T) const" + ) << "attempt to use absCoeff out of temperature range:" << nl + << " " << Tlow_ << " -> " << Thigh_ << "; T = " << T + << nl << abort(FatalError); } } @@ -96,6 +88,7 @@ Foam::radiation::absorptionCoeffs::coeffs } } + void Foam::radiation::absorptionCoeffs::init ( const dictionary& dict @@ -109,4 +102,6 @@ void Foam::radiation::absorptionCoeffs::init dict.lookup("loTcoeffs") >> lowACoeffs_; dict.lookup("hiTcoeffs") >> highACoeffs_; } + + // ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H index dfb22f5f0a..564745e89c 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H @@ -40,6 +40,7 @@ SourceFiles #include "List.H" #include "IOstreams.H" #include "IOdictionary.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { @@ -47,29 +48,33 @@ namespace radiation { /*---------------------------------------------------------------------------*\ - Class absorptionCoeffs Declaration + Class absorptionCoeffs Declaration \*---------------------------------------------------------------------------*/ class absorptionCoeffs { - public: + // Public data members + static const int nCoeffs_ = 6; typedef FixedList coeffArray; + private: // Private data // Temperature limits of applicability of functions - scalar Tcommon_; - scalar Tlow_; + scalar Tcommon_; - scalar Thigh_; + scalar Tlow_; - // Polynomio using inverse temperatures + scalar Thigh_; + + + // Polynomial using inverse temperatures bool invTemp_; coeffArray highACoeffs_; @@ -93,26 +98,28 @@ public: absorptionCoeffs() {} + // Destructor + ~absorptionCoeffs(); - ~absorptionCoeffs(); - // member functions + // Member functions //- Return the coefficients corresponding to the given temperature const coeffArray& coeffs(const scalar T) const; - // Init from a dictionary + // Initialise from a dictionary void init(const dictionary&); - // Init from an Istram + // Initialise from an Istream inline void init(Istream&) { - absorptionCoeffs(Istream); + absorptionCoeffs(Istream); } // Acces Functions + inline bool invTemp() const { return invTemp_; @@ -142,12 +149,15 @@ public: { return lowACoeffs_; } - }; -} // End namespace Foam +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace Foam } // End namespace radiation +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif +// ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C index 16efef5fb5..cbea255a14 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ - #include "blackBodyEmission.H" #include "dimensionedConstants.H" @@ -37,14 +36,15 @@ Foam::radiation::blackBodyEmission::blackBodyEmission label lambdaj, const volScalarField& T ) -:blackBodyEmissiveTable_(fn, instance, T.mesh()), -C1_("C1",dimensionSet(1,4,3,0,0,0,0),3.7419e-16), -C2_("C2",dimensionSet(0,1,0,1,0,0,0),14.388e-6), -bj_(0), -T_(T) +: + blackBodyEmissiveTable_(fn, instance, T.mesh()), + C1_("C1",dimensionSet(1, 4, 3, 0, 0, 0, 0), 3.7419e-16), + C2_("C2",dimensionSet(0, 1, 0, 1, 0, 0, 0), 14.388e-6), + bj_(0), + T_(T) { bj_.setSize(lambdaj); - for(label i=0; i < lambdaj; i++) + for (label i=0; i < lambdaj; i++) { bj_.set ( @@ -66,21 +66,24 @@ T_(T) } } -// * * * * * * * Destructor * * * * * * * * * * * * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + Foam::radiation::blackBodyEmission::~blackBodyEmission() {} + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + Foam::scalar Foam::radiation::blackBodyEmission::flambdaT ( const scalar lambdaT ) const { - return blackBodyEmissiveTable_.LookUp(lambdaT*1e6)[1]; + return blackBodyEmissiveTable_.LookUp(lambdaT*1.0e6)[1]; } - Foam::tmp Foam::radiation::blackBodyEmission::EbDeltaLambdaT ( @@ -125,7 +128,6 @@ Foam::radiation::blackBodyEmission::EbDeltaLambdaT } return Eb; } - } @@ -139,5 +141,4 @@ void Foam::radiation::blackBodyEmission::correct } - // ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H index 5236f78099..985dd9a202 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H @@ -33,6 +33,7 @@ SourceFiles \*---------------------------------------------------------------------------*/ + #ifndef blackModyEmission_H #define blackModyEmission_H @@ -42,6 +43,7 @@ SourceFiles #include "radiationConstants.H" #include "interpolationLookUpTable.H" #include "Vector2D.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -54,71 +56,82 @@ namespace radiation class blackBodyEmission { // Private data - mutable interpolationLookUpTable blackBodyEmissiveTable_; - scalar flambdaT(const scalar lambdaT) const; + mutable interpolationLookUpTable blackBodyEmissiveTable_; - const dimensionedScalar C1_; + scalar flambdaT(const scalar lambdaT) const; - const dimensionedScalar C2_; + const dimensionedScalar C1_; - // Ptr List for enregy black body emission - PtrList bj_; + const dimensionedScalar C2_; + + // Ptr List for enregy black body emission + PtrList bj_; + + // Reference to the temperature field + const volScalarField& T_; - // T - const volScalarField& T_; public: - // Constructors - blackBodyEmission - ( - const fileName& fn, - const word& instance, - label lambdaj, - const volScalarField& T - ); + + //- Construct from components + blackBodyEmission + ( + const fileName& fn, + const word& instance, + label lambdaj, + const volScalarField& T + ); + // Destructor ~blackBodyEmission(); - // - Spectral emission for the black body at T and lambda - inline dimensionedScalar EblambdaT - ( - const dimensionedScalar T, - const scalar lambda - ) const - { - return (C1_/(pow5(lambda)*(exp(C2_/(lambda*T))-1))); - } + // Member functions - // Integral Energy at T from lambda1 to lambda2 + // Access + + //- Black body spectrum + inline const volScalarField& bj(label i) const + { + return bj_[i]; + } + + //- Spectral emission for the black body at T and lambda + inline dimensionedScalar EblambdaT + ( + const dimensionedScalar T, + const scalar lambda + ) const + { + return (C1_/(pow5(lambda)*(exp(C2_/(lambda*T)) - 1))); + } + + //- Integral energy at T from lambda1 to lambda2 + tmp EbDeltaLambdaT + ( + const volScalarField& T, + const Vector2D& band + ) const; - tmp EbDeltaLambdaT //dimensionedScalar - ( - const volScalarField& T, - const Vector2D& band - ) const; // Edit // Update black body emission void correct(label j, const Vector2D& band); - - // Acces members - - // Black body spectrum - inline const volScalarField& bj(label i) const - { - return bj_[i]; - } - }; -} -} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam +} // End namespace radiation + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif + // ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C index 90b30142e2..c0286ca088 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C @@ -53,9 +53,9 @@ namespace Foam // Radiation solver iterator counter Foam::label Foam::radiation::fvDOM::iterRadId = pTraits