From d71b3c46331edc63bf28b1d5b3a44a76ae04784e Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Tue, 4 Jun 2024 10:10:24 +0100 Subject: [PATCH] ENH: radiation - temperature dependent properties ENH: radiationModel - expose T() --- .../MarshakRadiation/MarshakRadiationFvPatchScalarField.C | 2 +- .../greyDiffusiveRadiationMixedFvPatchScalarField.C | 4 ++-- .../wideBandDiffusiveRadiationMixedFvPatchScalarField.C | 8 +++++--- .../radiationModels/radiationModel/radiationModel.H | 3 +++ .../radiation/radiationModels/viewFactor/viewFactor.C | 4 ++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C index 369f03cc6c..6d0423954f 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C @@ -139,7 +139,7 @@ void Foam::radiation::MarshakRadiationFvPatchScalarField::updateCoeffs() const tmp temissivity ( - boundaryRadiation.emissivity(patch().index()) + boundaryRadiation.emissivity(patch().index(), 0, nullptr, &Tp) ); const scalarField& emissivity = temissivity(); diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index 6bcfb8437f..29c0f4a20c 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -178,14 +178,14 @@ updateCoeffs() const tmp temissivity ( - boundaryRadiation.emissivity(patch().index()) + boundaryRadiation.emissivity(patch().index(), 0, nullptr, &Tp) ); const scalarField& emissivity = temissivity(); const tmp ttransmissivity ( - boundaryRadiation.transmissivity(patch().index()) + boundaryRadiation.transmissivity(patch().index(), 0, nullptr, &Tp) ); const scalarField& transmissivity = ttransmissivity(); diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index 72486e7dbc..a021059e05 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -167,15 +167,17 @@ updateCoeffs() boundaryRadiationProperties::New(internalField().mesh()); + const auto& Tp = radiation.T().boundaryField()[patchi]; + const tmp temissivity ( - boundaryRadiation.emissivity(patch().index(), lambdaId) + boundaryRadiation.emissivity(patchi, lambdaId, nullptr, &Tp) ); const scalarField& emissivity = temissivity(); const tmp ttransmissivity ( - boundaryRadiation.transmissivity(patch().index(), lambdaId) + boundaryRadiation.transmissivity(patchi, lambdaId, nullptr, &Tp) ); const scalarField& transmissivity = ttransmissivity(); @@ -217,7 +219,7 @@ updateCoeffs() const volScalarField& qSec = this->db().lookupObject(qSecName); - Ir += qSec.boundaryField()[patch().index()]; + Ir += qSec.boundaryField()[patchi]; } } diff --git a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.H b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.H index a52350daad..cf730c0ce1 100644 --- a/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.H +++ b/src/thermophysicalModels/radiation/radiationModels/radiationModel/radiationModel.H @@ -240,6 +240,9 @@ public: return radiation_; } + //- Return access to the temperature field + const volScalarField& T() const noexcept { return T_; } + //- Source term component (for power of T^4) virtual tmp Rp() const = 0; diff --git a/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C b/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C index 9a1e62068d..d434b37a90 100644 --- a/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C +++ b/src/thermophysicalModels/radiation/radiationModels/viewFactor/viewFactor.C @@ -738,14 +738,14 @@ void Foam::radiation::viewFactor::calculate() fvPatchScalarField& qrPatch = qrBf[patchID]; - greyDiffusiveViewFactorFixedValueFvPatchScalarField& qrp = + auto& qrp = refCast < greyDiffusiveViewFactorFixedValueFvPatchScalarField >(qrPatch); const tmp teb = - boundaryRadiation.emissivity(patchID, bandI); + boundaryRadiation.emissivity(patchID, bandI, nullptr, &Tp); const scalarField& eb = teb();