Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fvOption::radiation: New fvOption providing the radiation source to t…
…he energy equation Radiative heat transfer may now be added to any solver in which an energy equation is solved at run-time rather than having to change the solver code. For example, radiative heat transfer is now enabled in the SandiaD_LTS reactingFoam tutorial by providing a constant/fvOptions file containing radiation { type radiation; libs ("libradiationModels.so"); } and appropriate settings in the constant/radiationProperties file.
- Loading branch information
Henry Weller
committed
Apr 13, 2017
1 parent
045014d
commit 9a06a1e
Showing
8 changed files
with
318 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
src/thermophysicalModels/radiation/fvOptions/radiation/radiation.C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/*---------------------------------------------------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | | ||
\\ / A nd | Copyright (C) 2017 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 <http://www.gnu.org/licenses/>. | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
#include "radiation.H" | ||
#include "fluidThermo.H" | ||
#include "fvMatrices.H" | ||
#include "addToRunTimeSelectionTable.H" | ||
|
||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // | ||
|
||
namespace Foam | ||
{ | ||
namespace fv | ||
{ | ||
defineTypeNameAndDebug(radiation, 0); | ||
|
||
addToRunTimeSelectionTable | ||
( | ||
option, | ||
radiation, | ||
dictionary | ||
); | ||
} | ||
} | ||
|
||
|
||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // | ||
|
||
Foam::fv::radiation::radiation | ||
( | ||
const word& sourceName, | ||
const word& modelType, | ||
const dictionary& dict, | ||
const fvMesh& mesh | ||
) | ||
: | ||
option(sourceName, modelType, dict, mesh) | ||
{ | ||
const basicThermo& thermo = | ||
mesh_.lookupObject<basicThermo>(basicThermo::dictName); | ||
|
||
fieldNames_.setSize(1); | ||
fieldNames_[0] = thermo.he().name(); | ||
applied_.setSize(fieldNames_.size(), false); | ||
|
||
radiation_ = Foam::radiation::radiationModel::New(thermo.T()); | ||
} | ||
|
||
|
||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // | ||
|
||
bool Foam::fv::radiation::read(const dictionary& dict) | ||
{ | ||
return option::read(dict); | ||
} | ||
|
||
|
||
void Foam::fv::radiation::addSup | ||
( | ||
const volScalarField& rho, | ||
fvMatrix<scalar>& eqn, | ||
const label fieldi | ||
) | ||
{ | ||
const basicThermo& thermo = | ||
mesh_.lookupObject<basicThermo>(basicThermo::dictName); | ||
|
||
radiation_->correct(); | ||
|
||
eqn += radiation_->Sh(thermo, eqn.psi()); | ||
} | ||
|
||
|
||
// ************************************************************************* // |
129 changes: 129 additions & 0 deletions
129
src/thermophysicalModels/radiation/fvOptions/radiation/radiation.H
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
/*---------------------------------------------------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | | ||
\\ / A nd | Copyright (C) 2017 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 <http://www.gnu.org/licenses/>. | ||
Class | ||
Foam::fv::radiation | ||
Description | ||
Calculates and applies the buoyancy energy source rho*(U&g) to the energy | ||
equation. | ||
Usage | ||
Example usage: | ||
\verbatim | ||
radiationCoeffs | ||
{ | ||
fields (h); // Name of energy field | ||
} | ||
\endverbatim | ||
SourceFiles | ||
radiation.C | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
#ifndef radiation_H | ||
#define radiation_H | ||
|
||
#include "fvOption.H" | ||
#include "uniformDimensionedFields.H" | ||
#include "radiationModel.H" | ||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
namespace Foam | ||
{ | ||
namespace fv | ||
{ | ||
|
||
/*---------------------------------------------------------------------------*\ | ||
Class radiation Declaration | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
class radiation | ||
: | ||
public option | ||
{ | ||
// Private data | ||
|
||
//- The radiation model pointer | ||
autoPtr<Foam::radiation::radiationModel> radiation_; | ||
|
||
|
||
// Private Member Functions | ||
|
||
//- Disallow default bitwise copy construct | ||
radiation(const radiation&); | ||
|
||
//- Disallow default bitwise assignment | ||
void operator=(const radiation&); | ||
|
||
|
||
public: | ||
|
||
//- Runtime type information | ||
TypeName("radiation"); | ||
|
||
|
||
// Constructors | ||
|
||
//- Construct from explicit source name and mesh | ||
radiation | ||
( | ||
const word& sourceName, | ||
const word& modelType, | ||
const dictionary& dict, | ||
const fvMesh& mesh | ||
); | ||
|
||
|
||
// Member Functions | ||
|
||
// Evaluate | ||
|
||
//- Add explicit contribution to compressible momentum equation | ||
virtual void addSup | ||
( | ||
const volScalarField& rho, | ||
fvMatrix<scalar>& eqn, | ||
const label fieldi | ||
); | ||
|
||
|
||
// IO | ||
|
||
//- Read source dictionary | ||
virtual bool read(const dictionary& dict); | ||
}; | ||
|
||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
} // End namespace fv | ||
} // End namespace Foam | ||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
#endif | ||
|
||
// ************************************************************************* // |
44 changes: 44 additions & 0 deletions
44
tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/0.orig/G
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/*--------------------------------*- C++ -*----------------------------------* \ | ||
| ========= | | | ||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | ||
| \\ / O peration | Version: dev | | ||
| \\ / A nd | Web: www.OpenFOAM.org | | ||
| \\/ M anipulation | | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
version 2.0; | ||
format ascii; | ||
class volScalarField; | ||
object G; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
dimensions [1 0 -3 0 0 0 0]; | ||
|
||
internalField uniform 0; | ||
|
||
boundaryField | ||
{ | ||
".*" | ||
{ | ||
type MarshakRadiation; | ||
T T; | ||
emissivityMode lookup; | ||
emissivity uniform 1.0; | ||
value uniform 0; | ||
} | ||
|
||
frontAndBack_pos | ||
{ | ||
type wedge; | ||
} | ||
|
||
frontAndBack_neg | ||
{ | ||
type wedge; | ||
} | ||
} | ||
|
||
|
||
// ************************************************************************* // |
24 changes: 24 additions & 0 deletions
24
tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/constant/fvOptions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
| ========= | | | ||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | ||
| \\ / O peration | Version: dev | | ||
| \\ / A nd | Web: www.OpenFOAM.org | | ||
| \\/ M anipulation | | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
version 2.0; | ||
format ascii; | ||
class dictionary; | ||
location "constant"; | ||
object fvOptions; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
radiation | ||
{ | ||
type radiation; | ||
libs ("libradiationModels.so"); | ||
} | ||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.