diff --git a/src/regionModels/surfaceFilmModels/Make/files b/src/regionModels/surfaceFilmModels/Make/files index 12f80a7ce7..8bda6f6aae 100644 --- a/src/regionModels/surfaceFilmModels/Make/files +++ b/src/regionModels/surfaceFilmModels/Make/files @@ -38,6 +38,7 @@ $(THERMOMODELS)/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveH $(THERMOMODELS)/filmRadiationModel/filmRadiationModel/filmRadiationModel.C $(THERMOMODELS)/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C $(THERMOMODELS)/filmRadiationModel/noRadiation/noRadiation.C +$(THERMOMODELS)/filmRadiationModel/constantRadiation/constantRadiation.C $(THERMOMODELS)/filmRadiationModel/standardRadiation/standardRadiation.C diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/constantRadiation/constantRadiation.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/constantRadiation/constantRadiation.C new file mode 100644 index 0000000000..ac0358f141 --- /dev/null +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/constantRadiation/constantRadiation.C @@ -0,0 +1,146 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 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 "constantRadiation.H" +#include "volFields.H" +#include "zeroGradientFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace regionModels +{ +namespace surfaceFilmModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(constantRadiation, 0); + +addToRunTimeSelectionTable +( + filmRadiationModel, + constantRadiation, + dictionary +); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +constantRadiation::constantRadiation +( + const surfaceFilmModel& owner, + const dictionary& dict +) +: + filmRadiationModel(typeName, owner, dict), + QrConst_ + ( + IOobject + ( + typeName + "::QrConst", + owner.time().timeName(), + owner.regionMesh(), + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + owner.regionMesh() + ), + mask_ + ( + IOobject + ( + typeName + "::mask", + owner.time().timeName(), + owner.regionMesh(), + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + owner.regionMesh(), + dimensionedScalar("one", dimless, 1.0), + zeroGradientFvPatchScalarField::typeName + ), + timeStart_(readScalar(coeffs_.lookup("timeStart"))), + duration_(readScalar(coeffs_.lookup("duration"))) +{ + mask_ = pos(mask_); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +constantRadiation::~constantRadiation() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void constantRadiation::correct() +{} + + +tmp constantRadiation::Shs() +{ + tmp tShs + ( + new volScalarField + ( + IOobject + ( + typeName + "::Shs", + owner().time().timeName(), + owner().regionMesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + owner().regionMesh(), + dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0), + zeroGradientFvPatchScalarField::typeName + ) + ); + + const scalar time = owner().time().value(); + + if ((time >= timeStart_) && (time <= timeStart_ + duration_)) + { + scalarField& Shs = tShs(); + const scalarField& Qr = QrConst_.internalField(); + const scalarField& alpha = owner_.alpha().internalField(); + + Shs = mask_*Qr*alpha; + } + + return tShs; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace regionModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/constantRadiation/constantRadiation.H b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/constantRadiation/constantRadiation.H new file mode 100644 index 0000000000..06e6fe676b --- /dev/null +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/constantRadiation/constantRadiation.H @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 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 . + +Class + Foam::constantRadiation + +Description + Film constant radiation model. The constant radiative flux is specified + by the user, and operated over a time interval defined by a start time and + duration. In addition, a mask can be applied to shield the film from the + radiation. + +SourceFiles + constantRadiation.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constantRadiation_H +#define constantRadiation_H + +#include "filmRadiationModel.H" +#include "volFieldsFwd.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace regionModels +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class constantRadiation Declaration +\*---------------------------------------------------------------------------*/ + +class constantRadiation +: + public filmRadiationModel +{ +private: + + // Private data + + //- Constant radiative flux [kg/s3] + volScalarField QrConst_; + + //- Radiation mask + volScalarField mask_; + + //- Time start [s] + const scalar timeStart_; + + //- Duration [s] + const scalar duration_; + + + // Private member functions + + //- Disallow default bitwise copy construct + constantRadiation(const constantRadiation&); + + //- Disallow default bitwise assignment + void operator=(const constantRadiation&); + + +public: + + //- Runtime type information + TypeName("constantRadiation"); + + + // Constructors + + //- Construct from surface film model and dictionary + constantRadiation + ( + const surfaceFilmModel& owner, + const dictionary& dict + ); + + + //- Destructor + virtual ~constantRadiation(); + + + // Member Functions + + // Evolution + + //- Correct + virtual void correct(); + + //- Return the radiation sensible enthalpy source + // Also updates QrNet + virtual tmp Shs(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace regionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* //