diff --git a/Allwmake b/Allwmake index 68accb90d..6d6eb7932 100755 --- a/Allwmake +++ b/Allwmake @@ -18,6 +18,7 @@ wmake src/dfCombustionModels wmake src/dynamicMesh wmake src/dynamicFvMesh wmake src/fluxSchemes +wmake src/radiationModels wmake applications/solvers/df0DFoam wmake applications/solvers/dfLowMachFoam diff --git a/src/dfCanteraMixture/Make/files b/src/dfCanteraMixture/Make/files index 568406377..d0a8234bf 100644 --- a/src/dfCanteraMixture/Make/files +++ b/src/dfCanteraMixture/Make/files @@ -1,4 +1,5 @@ CanteraMixture.C +dfSingleStepReactingMixture/dfSingleStepReactingMixture.C makeThermos.C diff --git a/src/dfCanteraMixture/dfSingleStepReactingMixture/dfSingleStepReactingMixture.C b/src/dfCanteraMixture/dfSingleStepReactingMixture/dfSingleStepReactingMixture.C new file mode 100755 index 000000000..7569f8f3d --- /dev/null +++ b/src/dfCanteraMixture/dfSingleStepReactingMixture/dfSingleStepReactingMixture.C @@ -0,0 +1,382 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "dfSingleStepReactingMixture.H" +#include "fvMesh.H" + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + + +void Foam::dfSingleStepReactingMixture::calculateqFuel() +{ + // 第0条反应 + // const Reaction& reaction = this->operator[](0); + + + // 遍历反应左边各组分 + // Cantera可以提供stoichCoeff + // forAll(reaction.lhs(), i) + // { + // const label speciei = reaction.lhs()[i].index;//组分索引 + // const scalar stoichCoeff = reaction.lhs()[i].stoichCoeff; + // specieStoichCoeffs_[speciei] = -stoichCoeff; + // qFuel_.value() += this->speciesData()[speciei].hc()*stoichCoeff/Wu; + // } + + // 遍历反应右边各组分 + // forAll(reaction.rhs(), i) + // { + // const label speciei = reaction.rhs()[i].index; + // const scalar stoichCoeff = reaction.rhs()[i].stoichCoeff; + // specieStoichCoeffs_[speciei] = stoichCoeff; + // qFuel_.value() -= this->speciesData()[speciei].hc()*stoichCoeff/Wu; + // specieProd_[speciei] = -1;//反应物是1,产物是-1 + // } + + const scalar Wu = this->Wi(fuelIndex_); + Info << " reactant number = " << reactants_.size() << endl; + forAll(reactants_, i) + { + const int speciei = reactants_[i]; + const double stoichCoeff = this->CanteraKinetics()->reactantStoichCoeff(speciei, 0); + Info << "reactant stoich coeffs :" << stoichCoeff << endl; + specieStoichCoeffs_[speciei] = -stoichCoeff; + qFuel_.value() += this->CanteraGas()->Hf298SS(speciei)*stoichCoeff/Wu; + } + forAll(products_, i) + { + const int speciei = products_[i]; + const double stoichCoeff = this->CanteraKinetics()->productStoichCoeff(speciei, 0); + specieStoichCoeffs_[speciei] = stoichCoeff; + qFuel_.value() -= this->CanteraGas()->Hf298SS(speciei)*stoichCoeff/Wu; + specieProd_[speciei] = -1; + } + + Info << "Fuel heat of combustion :" << qFuel_.value() << endl; +} + + + +void Foam::dfSingleStepReactingMixture::massAndAirStoichRatios() +{ + const label O2Index = this->species()["O2"]; + // const scalar Wu = this->speciesData()[fuelIndex_].W(); + const scalar Wu = this->Wi(fuelIndex_); + + stoicRatio_ = + (this->Wi(inertIndex_) + * specieStoichCoeffs_[inertIndex_] + + this->Wi(O2Index) + * mag(specieStoichCoeffs_[O2Index])) + / (Wu*mag(specieStoichCoeffs_[fuelIndex_])); + + s_ = + (this->Wi(O2Index) + * mag(specieStoichCoeffs_[O2Index])) + / (Wu*mag(specieStoichCoeffs_[fuelIndex_])); + + + Info << "fuel stoich coeffs :" << specieStoichCoeffs_[fuelIndex_] << endl; + + Info << "stoichiometric air-fuel ratio :" << stoicRatio_.value() << endl; + + Info << "stoichiometric oxygen-fuel ratio :" << s_.value() << endl; +} + + + +void Foam::dfSingleStepReactingMixture::calculateMaxProducts() +{ + // const Reaction& reaction = this->operator[](0); + + scalar Wm = 0.0; + scalar totalMol = 0.0; + // forAll(reaction.rhs(), i) + // { + // label speciei = reaction.rhs()[i].index; + // totalMol += mag(specieStoichCoeffs_[speciei]); + // } + std::string products = this->CanteraKinetics()->productString(0); + forAll(products_, i) + { + const int speciei = products_[i]; + totalMol += mag(specieStoichCoeffs_[speciei]); + } + + // scalarList Xi(reaction.rhs().size()); + scalarList Xi(products_.size()); + + // forAll(reaction.rhs(), i) + // { + // const label speciei = reaction.rhs()[i].index; + // Xi[i] = mag(specieStoichCoeffs_[speciei])/totalMol; + + // Wm += Xi[i]*this->speciesData()[speciei].W(); + // } + + forAll(products_, i) + { + const int speciei = products_[i]; + Xi[i] = mag(specieStoichCoeffs_[speciei])/totalMol; + + Wm += Xi[i]*this->Wi(speciei); + } + + // forAll(reaction.rhs(), i) + // { + // const label speciei = reaction.rhs()[i].index; + // Yprod0_[speciei] = this->speciesData()[speciei].W()/Wm*Xi[i]; + // } + + forAll(products_, i) + { + const int speciei = products_[i]; + Yprod0_[speciei] = this->Wi(speciei)/Wm*Xi[i]; + } + + Info << "Maximum products mass concentrations:" << nl; + forAll(Yprod0_, i) + { + if (Yprod0_[i] > 0) + { + Info<< " " << this->species()[i] << ": " << Yprod0_[i] << nl; + } + } + + // Normalize the stoichiometric coeff to mass + forAll(specieStoichCoeffs_, i) + { + specieStoichCoeffs_[i] = + specieStoichCoeffs_[i] + * this->Wi(i) + / (this->Wi(fuelIndex_) + * mag(specieStoichCoeffs_[fuelIndex_])); + } +} + + + +void Foam::dfSingleStepReactingMixture::fresCorrect() +{ + // const Reaction& reaction = this->operator[](0); + + label O2Index = this->species()["O2"]; + const volScalarField& YFuel = this->Y()[fuelIndex_]; + const volScalarField& YO2 = this->Y()[O2Index]; + + // // reactants + // forAll(reaction.lhs(), i) + // { + // const label speciei = reaction.lhs()[i].index; + // if (speciei == fuelIndex_) + // { + // fres_[speciei] = max(YFuel - YO2/s_, scalar(0)); + // } + // else if (speciei == O2Index) + // { + // fres_[speciei] = max(YO2 - YFuel*s_, scalar(0)); + // } + // } + + forAll(reactants_, i) + { + const int speciei = reactants_[i]; + if (speciei == fuelIndex_) + { + fres_[speciei] = max(YFuel - YO2/s_, scalar(0)); + } + else if (speciei == O2Index) + { + fres_[speciei] = max(YO2 - YFuel*s_, scalar(0)); + } + } + + + // // products + // forAll(reaction.rhs(), i) + // { + // const label speciei = reaction.rhs()[i].index; + // if (speciei != inertIndex_) + // { + // forAll(fres_[speciei], celli) + // { + // if (fres_[fuelIndex_][celli] > 0.0) + // { + // // rich mixture + // fres_[speciei][celli] = + // Yprod0_[speciei] + // * (1.0 + YO2[celli]/s_.value() - YFuel[celli]); + // } + // else + // { + // // lean mixture + // fres_[speciei][celli] = + // Yprod0_[speciei] + // * ( + // 1.0 + // - YO2[celli]/s_.value()*stoicRatio_.value() + // + YFuel[celli]*stoicRatio_.value() + // ); + // } + // } + // } + // } + forAll(products_, i) + { + const int speciei = products_[i]; + if (speciei != inertIndex_) + { + forAll(fres_[speciei], celli) + { + if (fres_[fuelIndex_][celli] > 0.0) + { + // rich mixture + fres_[speciei][celli] = + Yprod0_[speciei] + * (1.0 + YO2[celli]/s_.value() - YFuel[celli]); + } + else + { + // lean mixture + fres_[speciei][celli] = + Yprod0_[speciei] + * ( + 1.0 + - YO2[celli]/s_.value()*stoicRatio_.value() + + YFuel[celli]*stoicRatio_.value() + ); + } + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + + +Foam::dfSingleStepReactingMixture::dfSingleStepReactingMixture +( + const dictionary& thermoDict, + const fvMesh& mesh, + const word& phaseName +) +: + CanteraMixture(thermoDict, mesh, phaseName), + stoicRatio_(dimensionedScalar("stoicRatio", dimless, 0)), + s_(dimensionedScalar("s", dimless, 0)), + qFuel_(dimensionedScalar("qFuel", sqr(dimVelocity), 0)), + specieStoichCoeffs_(this->species().size(), 0.0), + Yprod0_(this->species().size(), 0.0), + fres_(Yprod0_.size()), + inertIndex_(this->species()[thermoDict.lookup("inertSpecie")]), + fuelIndex_(this->species()[thermoDict.lookup("fuel")]), + specieProd_(Yprod0_.size(), 1) +{ + if (this->nReactions() == 1) + { + forAll(fres_, fresI) + { + IOobject header + ( + "fres_" + this->species()[fresI], + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ); + + fres_.set + ( + fresI, + new volScalarField + ( + header, + mesh, + dimensionedScalar("fres" + name(fresI), dimless, 0) + ) + ); + } + + std::string reactants = this->CanteraKinetics()->reactantString(0); + std::string products = this->CanteraKinetics()->productString(0); + Info << "reactants: " << reactants << endl; + for(int i=0; inSpecies(); ++i) + { + word name = this->CanteraGas()->speciesName(i); + if(reactants.find(name) != std::string::npos) + { + reactants_.append(i); + } + else if(products.find(name) != std::string::npos) + { + products_.append(i); + } + } + Info << "reactants: " << reactants_ << endl; + + calculateqFuel(); + + massAndAirStoichRatios(); + + calculateMaxProducts(); + } + else + { + FatalErrorInFunction + << "Only one reaction required for single step reaction" + << exit(FatalError); + } + + // std::string reactants = this->CanteraKinetics()->reactantString(0); + // std::string products = this->CanteraKinetics()->productString(0); + // Info << "reactants: " << reactants << endl; + // for(int i=0; inSpecies(); ++i) + // { + // word name = this->CanteraGas()->speciesName(i); + // if(reactants.find(name) != std::string::npos) + // { + // reactants_.append(i); + // } + // else if(products.find(name) != std::string::npos) + // { + // products_.append(i); + // } + // } + // Info << "reactants: " << reactants_ << endl; +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +void Foam::dfSingleStepReactingMixture::read +( + const dictionary& thermoDict +) +{} + + +// ************************************************************************* // diff --git a/src/dfCanteraMixture/dfSingleStepReactingMixture/dfSingleStepReactingMixture.H b/src/dfCanteraMixture/dfSingleStepReactingMixture/dfSingleStepReactingMixture.H new file mode 100755 index 000000000..a317d0313 --- /dev/null +++ b/src/dfCanteraMixture/dfSingleStepReactingMixture/dfSingleStepReactingMixture.H @@ -0,0 +1,210 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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::dfSingleStepReactingMixture + +Description + Single step reacting mixture + +SourceFiles + dfSingleStepReactingMixture.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dfSingleStepReactingMixture_H +#define dfSingleStepReactingMixture_H + +// #include "chemistryReader.H" +// #include "reactingMixture.H" +#include "CanteraMixture.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class dfSingleStepReactingMixture Declaration +\*---------------------------------------------------------------------------*/ + +class dfSingleStepReactingMixture +: + public CanteraMixture +{ + +protected: + + // Protected data + + //- Stoichiometric air-fuel mass ratio + dimensionedScalar stoicRatio_; + + //- Stoichiometric oxygen-fuel mass ratio + dimensionedScalar s_; + + //- Heat of combustion [J/Kg] + dimensionedScalar qFuel_; + + //- Stoichiometric coefficient for the reaction. + scalarList specieStoichCoeffs_; + + //- Mass concentrations at stoichiometric mixture for fres. + scalarList Yprod0_; + + //- List of components residual + PtrList fres_; + + //- Inert specie index + label inertIndex_; + + //- Fuel specie index + label fuelIndex_; + + //- reactants species index + List reactants_; + + //- products species index + List products_; + + //- List to indicate if specie is produced/consumed + List specieProd_; + + + // Protected member functions + + //- Calculate qFuel + void calculateqFuel(); + + //- Calculate air/fuel and oxygen/fuel ratio + void massAndAirStoichRatios(); + + //- Calculate maximum products at stoichiometric mixture + void calculateMaxProducts(); + + +public: + + //- The type of thermo package this mixture is instantiated for + // typedef ThermoType thermoType; + + + // Constructors + + //- Construct from dictionary, mesh and phase name + dfSingleStepReactingMixture + ( + const dictionary&, + const fvMesh&, + const word& + ); + + //- Disallow default bitwise copy construction + dfSingleStepReactingMixture(const dfSingleStepReactingMixture&) = delete; + + + //- Destructor + virtual ~dfSingleStepReactingMixture() + {} + + + // Member Functions + + //- Return the instantiated type name + static word typeName() + { + return "dfSingleStepReactingMixture"; + } + + //- Calculates the residual for all components + void fresCorrect(); + + + // Access functions + + //- Return the stoichiometric air-fuel mass ratio + inline const dimensionedScalar stoicRatio() const; + + //- Return the Stoichiometric oxygen-fuel mass ratio + inline const dimensionedScalar s() const; + + //- Return the heat of combustion [J/Kg] + inline const dimensionedScalar qFuel() const; + + //- Return the stoichiometric coefficient for the reaction + inline const List& specieStoichCoeffs() const; + + //- Return the list of components residual + inline tmp fres(const label index) const; + + //- Return the inert specie index + inline label inertIndex() const; + + //- Return the fuel specie index + inline label fuelIndex() const; + + //- Return the list to indicate if specie is produced/consumed + inline const List& specieProd() const; + + //- Return the list of products mass concentrations + inline const scalarList& Yprod0() const; + + //- Return the list of products species index + inline const List& getProducts() const; + + //- Return the list of reactants species index + inline const List& getReactants() const; + + + // I-O + + //- Read dictionary + void read(const dictionary&); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const dfSingleStepReactingMixture&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "dfSingleStepReactingMixtureI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// #ifdef NoRepository +// #include "dfSingleStepReactingMixture.C" +// #endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dfCanteraMixture/dfSingleStepReactingMixture/dfSingleStepReactingMixtureI.H b/src/dfCanteraMixture/dfSingleStepReactingMixture/dfSingleStepReactingMixtureI.H new file mode 100755 index 000000000..10a2cf9a6 --- /dev/null +++ b/src/dfCanteraMixture/dfSingleStepReactingMixture/dfSingleStepReactingMixtureI.H @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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 "dfSingleStepReactingMixture.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +inline const Foam::dimensionedScalar +Foam::dfSingleStepReactingMixture::stoicRatio() const +{ + return stoicRatio_; +} + + + +inline const Foam::dimensionedScalar +Foam::dfSingleStepReactingMixture::s() const +{ + return s_; +} + + + +inline const Foam::dimensionedScalar +Foam::dfSingleStepReactingMixture::qFuel() const +{ + return qFuel_; +} + + + +inline const Foam::List& +Foam::dfSingleStepReactingMixture::specieStoichCoeffs() const +{ + return specieStoichCoeffs_; +} + + + +inline Foam::tmp +Foam::dfSingleStepReactingMixture::fres +( + const label index +) const +{ + return fres_[index]; +} + + + +inline Foam::label +Foam::dfSingleStepReactingMixture::inertIndex() const +{ + return inertIndex_; +} + + + +inline Foam::label +Foam::dfSingleStepReactingMixture::fuelIndex() const +{ + return fuelIndex_; +} + + + +inline const Foam::List& +Foam::dfSingleStepReactingMixture::specieProd() const +{ + return specieProd_; +} + + + +inline const Foam::scalarList& +Foam::dfSingleStepReactingMixture::Yprod0() const +{ + return Yprod0_; +} + +inline const Foam::List& +Foam::dfSingleStepReactingMixture::getProducts() const +{ + return products_; +} + +inline const Foam::List& +Foam::dfSingleStepReactingMixture::getReactants() const +{ + return reactants_; +} + +// ************************************************************************* // diff --git a/src/dfCanteraMixture/makeThermos.C b/src/dfCanteraMixture/makeThermos.C index 99ad2c4bc..8f4d13963 100644 --- a/src/dfCanteraMixture/makeThermos.C +++ b/src/dfCanteraMixture/makeThermos.C @@ -27,6 +27,7 @@ License // #include "psiThermo.H" #include "rhoThermo.H" #include "CanteraMixture.H" +#include "dfSingleStepReactingMixture.H" // #include "hePsiThermo.H" #include "heRhoThermo.H" #include "addToRunTimeSelectionTable.H" @@ -75,6 +76,7 @@ namespace Foam // makeThermoPhysicsThermos(hePsiThermo, CanteraMixture, psiThermo); makeThermoPhysicsThermos(heRhoThermo, CanteraMixture, rhoThermo); +makeThermoPhysicsThermos(heRhoThermo, dfSingleStepReactingMixture, rhoThermo); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/radiationModels/Make/files b/src/radiationModels/Make/files new file mode 100644 index 000000000..c0560197b --- /dev/null +++ b/src/radiationModels/Make/files @@ -0,0 +1,46 @@ +/* Radiation model */ +radiationModels/radiationModel/radiationModel.C +radiationModels/radiationModel/radiationModelNew.C +radiationModels/noRadiation/noRadiation.C +radiationModels/P1/P1.C +radiationModels/fvDOM/fvDOM.C +radiationModels/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C +radiationModels/fvDOM/blackBodyEmission/blackBodyEmission.C +radiationModels/fvDOM/absorptionCoeffs/absorptionCoeffs.C +radiationModels/viewFactor/viewFactor.C +radiationModels/opaqueSolid/opaqueSolid.C + +/* Scatter model */ +scatterModels/scatterModel/scatterModel.C +scatterModels/scatterModel/scatterModelNew.C +scatterModels/noScatter/noScatter.C +scatterModels/constantScatter/constantScatter.C + +/* Absorption/Emission model */ +absorptionEmissionModels/absorptionEmissionModel/absorptionEmissionModel.C +absorptionEmissionModels/absorptionEmissionModel/absorptionEmissionModelNew.C +absorptionEmissionModels/noAbsorptionEmission/noAbsorptionEmission.C +absorptionEmissionModels/constantAbsorptionEmission/constantAbsorptionEmission.C +absorptionEmissionModels/binary/binary.C +absorptionEmissionModels/greyMean/greyMean.C +absorptionEmissionModels/wideBand/wideBand.C +/*absorptionEmissionModels/greyMeanSolid/greyMeanSolid.C*/ + +/* Soot model */ +sootModels/sootModel/sootModel.C +sootModels/sootModel/sootModelNew.C +sootModels/mixtureFraction/mixtureFractions.C +sootModels/noSoot/noSoot.C + +/* Boundary conditions */ +derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C +derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C +derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C +derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C + +/* fvOptions */ +fvOptions/radiation/radiation.C + +LIB = $(DF_LIBBIN)/libdfRadiationModels diff --git a/src/radiationModels/Make/options b/src/radiationModels/Make/options new file mode 100644 index 000000000..9a06a92c2 --- /dev/null +++ b/src/radiationModels/Make/options @@ -0,0 +1,20 @@ +EXE_INC = \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(DF_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ + -I$(DF_SRC)/thermophysicalModels/SLGThermo/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(DF_SRC)/dfCanteraMixture/lnInclude \ + -I$(CANTERA_ROOT)/include + +LIB_LIBS = \ + -lcompressibleTransportModels \ + -lfiniteVolume \ + -lmeshTools \ + -L$(DF_LIBBIN) \ + -ldfCanteraMixture \ + -ldfThermophysicalProperties \ + -ldfSLGThermo \ + -ldfFluidThermophysicalModels diff --git a/src/radiationModels/absorptionEmissionModels/absorptionEmissionModel/absorptionEmissionModel.C b/src/radiationModels/absorptionEmissionModels/absorptionEmissionModel/absorptionEmissionModel.C new file mode 100644 index 000000000..871bcf081 --- /dev/null +++ b/src/radiationModels/absorptionEmissionModels/absorptionEmissionModel/absorptionEmissionModel.C @@ -0,0 +1,183 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 "absorptionEmissionModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace radiationModels + { + defineTypeNameAndDebug(absorptionEmissionModel, 0); + defineRunTimeSelectionTable(absorptionEmissionModel, dictionary); + } +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::radiationModels::absorptionEmissionModel::absorptionEmissionModel +( + const dictionary& dict, + const fvMesh& mesh +) +: + dict_(dict), + mesh_(mesh) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // + +Foam::radiationModels::absorptionEmissionModel::~absorptionEmissionModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::radiationModels::absorptionEmissionModel::a(const label bandI) const +{ + return aDisp(bandI) + aCont(bandI); +} + + +Foam::tmp +Foam::radiationModels::absorptionEmissionModel::aCont(const label bandI) const +{ + return volScalarField::New + ( + "aCont", + mesh_, + dimensionedScalar(dimless/dimLength, 0) + ); +} + + +Foam::tmp +Foam::radiationModels::absorptionEmissionModel::aDisp(const label bandI) const +{ + return volScalarField::New + ( + "aDisp", + mesh_, + dimensionedScalar(dimless/dimLength, 0) + ); +} + + +Foam::tmp +Foam::radiationModels::absorptionEmissionModel::e(const label bandI) const +{ + return eDisp(bandI) + eCont(bandI); +} + + +Foam::tmp +Foam::radiationModels::absorptionEmissionModel::eCont(const label bandI) const +{ + return volScalarField::New + ( + "eCont", + mesh_, + dimensionedScalar(dimless/dimLength, 0) + ); +} + + +Foam::tmp +Foam::radiationModels::absorptionEmissionModel::eDisp(const label bandI) const +{ + return volScalarField::New + ( + "eDisp", + mesh_, + dimensionedScalar(dimless/dimLength, 0) + ); +} + + +Foam::tmp +Foam::radiationModels::absorptionEmissionModel::E(const label bandI) const +{ + return EDisp(bandI) + ECont(bandI); +} + + +Foam::tmp +Foam::radiationModels::absorptionEmissionModel::ECont(const label bandI) const +{ + return volScalarField::New + ( + "ECont", + mesh_, + dimensionedScalar(dimMass/dimLength/pow3(dimTime), 0) + ); +} + + +Foam::tmp +Foam::radiationModels::absorptionEmissionModel::EDisp(const label bandI) const +{ + return volScalarField::New + ( + "EDisp", + mesh_, + dimensionedScalar(dimMass/dimLength/pow3(dimTime), 0) + ); +} + + +Foam::label Foam::radiationModels::absorptionEmissionModel::nBands() const +{ + return pTraits