From c6a04e7242baef030bc594ac3f2a94c227106782 Mon Sep 17 00:00:00 2001 From: Dominik Christ Date: Thu, 3 Apr 2014 16:00:47 +0100 Subject: [PATCH] Removed dependency on objectRegistry in constructor --- .../MarshakRadiationMixedFvPatchScalarField.C | 21 ++++++++++++----- ...iffusiveRadiationMixedFvPatchScalarField.C | 14 +++++------ ...iffusiveRadiationMixedFvPatchScalarField.C | 23 ++++++++++++------- 3 files changed, 37 insertions(+), 21 deletions(-) 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()); } }