Merge remote-tracking branch 'origin/BUGFIX/radiationBCConstructor' into nextRelease

This commit is contained in:
Hrvoje Jasak 2014-04-10 17:51:01 +01:00
commit d599aa8597
3 changed files with 37 additions and 21 deletions

View file

@ -75,21 +75,30 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField
TName_(dict.lookup("T")), TName_(dict.lookup("T")),
emissivity_(readScalar(dict.lookup("emissivity"))) emissivity_(readScalar(dict.lookup("emissivity")))
{ {
const scalarField& Tp =
lookupPatchField<volScalarField, scalar>(TName_);
refValue() = 4.0*radiation::sigmaSB.value()*pow4(Tp);
refGrad() = 0.0;
if (dict.found("value")) if (dict.found("value"))
{ {
fvPatchScalarField::operator= fvPatchScalarField::operator=
( (
scalarField("value", dict, p.size()) scalarField("value", dict, p.size())
); );
refValue() = scalarField("value", dict, p.size());
refGrad() = 0;
valueFraction() = 1;
} }
else else
{ {
// No value given. Restart as fixedValue b.c.
// Bugfix: Do not initialize from temperautre because it is unavailable
// when running, e.g. decomposePar and loading radiation as
// shared library. Initialize to zero instead.
// 26 Mar 2014 - DC
refValue() = 0;
refGrad() = 0;
valueFraction() = 0;
fvPatchScalarField::operator=(refValue()); fvPatchScalarField::operator=(refValue());
} }
} }

View file

@ -93,15 +93,15 @@ greyDiffusiveRadiationMixedFvPatchScalarField
{ {
// No value given. Restart as fixedValue b.c. // No value given. Restart as fixedValue b.c.
const scalarField& Tp = // Bugfix: Do not initialize from temperautre because it is unavailable
lookupPatchField<volScalarField, scalar>(TName_); // when running, e.g. decomposePar and loading radiation as
// shared library. Initialize to zero instead.
// 26 Mar 2014 - DC
refValue() = refValue() = 0;
emissivity_*4.0*radiation::sigmaSB.value()*pow4(Tp)
/Foam::mathematicalConstant::pi;
refGrad() = 0.0; refGrad() = 0;
valueFraction() = 1.0; valueFraction() = 1;
fvPatchScalarField::operator=(refValue()); fvPatchScalarField::operator=(refValue());
} }

View file

@ -79,23 +79,30 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField
TName_(dict.lookup("T")), TName_(dict.lookup("T")),
emissivity_(readScalar(dict.lookup("emissivity"))) emissivity_(readScalar(dict.lookup("emissivity")))
{ {
const scalarField& Tp =
lookupPatchField<volScalarField, scalar>(TName_);
refValue() =
emissivity_*4.0*radiation::sigmaSB.value()*pow4(Tp)
/Foam::mathematicalConstant::pi;
refGrad() = 0.0;
if (dict.found("value")) if (dict.found("value"))
{ {
fvPatchScalarField::operator= fvPatchScalarField::operator=
( (
scalarField("value", dict, p.size()) scalarField("value", dict, p.size())
); );
refValue() = scalarField("value", dict, p.size());
refGrad() = 0;
valueFraction() = 1;
} }
else else
{ {
// No value given. Restart as fixedValue b.c.
// Bugfix: Do not initialize from temperautre because it is unavailable
// when running, e.g. decomposePar and loading radiation as
// shared library. Initialize to zero instead.
// 26 Mar 2014 - DC
refValue() = 0;
refGrad() = 0;
valueFraction() = 1;
fvPatchScalarField::operator=(refValue()); fvPatchScalarField::operator=(refValue());
} }
} }