/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "greyDiffusiveViewFactorFixedValueFvPatchScalarField.H" #include "addToRunTimeSelectionTable.H" #include "fieldMapper.H" #include "volFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::greyDiffusiveViewFactorFixedValueFvPatchScalarField:: greyDiffusiveViewFactorFixedValueFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict ) : fixedValueFvPatchScalarField(p, iF, dict, false), radiationCoupledBase(p, dict), qro_("qro", dimensions::heatFluxDensity, dict, p.size()) { if (dict.found("value")) { fvPatchScalarField::operator= ( scalarField("value", iF.dimensions(), dict, p.size()) ); } else { fvPatchScalarField::operator=(0.0); } } Foam::greyDiffusiveViewFactorFixedValueFvPatchScalarField:: greyDiffusiveViewFactorFixedValueFvPatchScalarField ( const greyDiffusiveViewFactorFixedValueFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField& iF, const fieldMapper& mapper ) : fixedValueFvPatchScalarField(ptf, p, iF, mapper), radiationCoupledBase ( patch(), ptf.emissivityMethod(), ptf.emissivity_, mapper ), qro_(mapper(ptf.qro_)) {} Foam::greyDiffusiveViewFactorFixedValueFvPatchScalarField:: greyDiffusiveViewFactorFixedValueFvPatchScalarField ( const greyDiffusiveViewFactorFixedValueFvPatchScalarField& ptf, const DimensionedField& iF ) : fixedValueFvPatchScalarField(ptf, iF), radiationCoupledBase ( ptf.patch(), ptf.emissivityMethod(), ptf.emissivity_ ), qro_(ptf.qro_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::greyDiffusiveViewFactorFixedValueFvPatchScalarField::map ( const fvPatchScalarField& ptf, const fieldMapper& mapper ) { fixedValueFvPatchScalarField::map(ptf, mapper); radiationCoupledBase::map(ptf, mapper); const greyDiffusiveViewFactorFixedValueFvPatchScalarField& mrptf = refCast(ptf); mapper(qro_, mrptf.qro_); } void Foam::greyDiffusiveViewFactorFixedValueFvPatchScalarField::reset ( const fvPatchScalarField& ptf ) { fixedValueFvPatchScalarField::reset(ptf); radiationCoupledBase::reset(ptf); const greyDiffusiveViewFactorFixedValueFvPatchScalarField& mrptf = refCast(ptf); qro_.reset(mrptf.qro_); } void Foam::greyDiffusiveViewFactorFixedValueFvPatchScalarField::updateCoeffs() { if (this->updated()) { return; } if (debug) { scalar Q = gSum((field())*patch().magSf()); Info<< patch().mesh().name() << ':' << patch().name() << ':' << this->internalField().name() << " <- " << " heat transfer rate:" << Q << " wall radiative heat flux " << " min:" << gMin(field()) << " max:" << gMax(field()) << " avg:" << gAverage(field()) << endl; } fixedValueFvPatchScalarField::updateCoeffs(); } void Foam::greyDiffusiveViewFactorFixedValueFvPatchScalarField::write ( Ostream& os ) const { fixedValueFvPatchScalarField::write(os); radiationCoupledBase::write(os); writeEntry(os, "qro", qro_); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { makePatchTypeField ( fvPatchScalarField, greyDiffusiveViewFactorFixedValueFvPatchScalarField ); } // ************************************************************************* //