diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C index e16b58f45..9a11b0c16 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C @@ -75,21 +75,30 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField TName_(dict.lookup("T")), emissivity_(readScalar(dict.lookup("emissivity"))) { - const scalarField& Tp = - lookupPatchField(TName_); - - refValue() = 4.0*radiation::sigmaSB.value()*pow4(Tp); - refGrad() = 0.0; - if (dict.found("value")) { fvPatchScalarField::operator= ( scalarField("value", dict, p.size()) ); + refValue() = scalarField("value", dict, p.size()); + + refGrad() = 0; + valueFraction() = 1; } 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()); } } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index c990b30e9..181a66edc 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -93,15 +93,15 @@ greyDiffusiveRadiationMixedFvPatchScalarField { // No value given. Restart as fixedValue b.c. - const scalarField& Tp = - lookupPatchField(TName_); + // 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() = - emissivity_*4.0*radiation::sigmaSB.value()*pow4(Tp) - /Foam::mathematicalConstant::pi; + refValue() = 0; - refGrad() = 0.0; - valueFraction() = 1.0; + refGrad() = 0; + valueFraction() = 1; fvPatchScalarField::operator=(refValue()); } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index af4fce40e..c2df23e43 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -79,23 +79,30 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField TName_(dict.lookup("T")), emissivity_(readScalar(dict.lookup("emissivity"))) { - const scalarField& Tp = - lookupPatchField(TName_); - - refValue() = - emissivity_*4.0*radiation::sigmaSB.value()*pow4(Tp) - /Foam::mathematicalConstant::pi; - refGrad() = 0.0; - if (dict.found("value")) { fvPatchScalarField::operator= ( scalarField("value", dict, p.size()) ); + refValue() = scalarField("value", dict, p.size()); + + refGrad() = 0; + valueFraction() = 1; } 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()); } }