Advanced Multi-Physics (AMP)
On-Line Documentation
RadiationDiffusionModel.h
Go to the documentation of this file.
1#ifndef RAD_DIF_MODEL
2#define RAD_DIF_MODEL
3
4#include "AMP/mesh/Mesh.h"
5#include "AMP/mesh/MeshElement.h"
6#include "AMP/operators/radiationDiffusionFD/RadiationDiffusionFDDiscretization.h"
7#include "AMP/utils/Constants.h"
8#include "AMP/utils/Database.h"
9
10namespace AMP::Operator {
11
12#define PI AMP::Constants::pi
13
34{
35
36public:
40
42 RadDifModel( std::shared_ptr<AMP::Database> basic_db_,
43 std::shared_ptr<AMP::Database> mspecific_db_ );
44
46 virtual ~RadDifModel(){};
47
49 double getCurrentTime() const;
50
52 void setCurrentTime( double currentTime_ );
53
55 virtual double sourceTerm( size_t component, const AMP::Mesh::Point &point ) const = 0;
56
58 virtual double initialCondition( size_t component, const AMP::Mesh::Point &point ) const = 0;
59
61 virtual double exactSolution( size_t component, const AMP::Mesh::Point &point ) const;
62
64 std::shared_ptr<AMP::Database> getRadiationDiffusionFD_input_db() const;
65
68
69 // Data
70protected:
72 double d_k11 = 0;
73 double d_k12 = 0;
74 double d_k21 = 0;
75 double d_k22 = 0;
76
79 std::array<double, 6> d_ak{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
80 std::array<double, 6> d_bk{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
81
83 double d_zatom = 1.0;
84
86 double d_currentTime = 0.0;
87
89 size_t d_dim = (size_t) -1;
90
92 std::shared_ptr<AMP::Database> d_basic_db;
93
95 std::shared_ptr<AMP::Database> d_mspecific_db;
96
98 std::shared_ptr<AMP::Database> d_RadiationDiffusionFD_input_db = nullptr;
99
102
105
106 // Methods
107protected:
108 /* Convert specific model parameters into parameters expected by the general formulation */
109 virtual void finalizeGeneralPDEModel_db() = 0;
110
114
116 double diffusionCoefficientE( double T, double zatom ) const;
117};
118
119
120/* -----------------------------------------------------------------------------------------------
121 Class representing certain Radiation diffusion equations considered by Mousseau et al. (2000)
122------------------------------------------------------------------------------------------------ */
160{
161
162 //
163public:
164 Mousseau_etal_2000_RadDifModel( std::shared_ptr<AMP::Database> basic_db_,
165 std::shared_ptr<AMP::Database> mspecific_db_ );
166
168
169 double sourceTerm( size_t component, const AMP::Mesh::Point &point ) const override;
170
171 double initialCondition( size_t component, const AMP::Mesh::Point &point ) const override;
172
173 //
174private:
176};
177
178
179/* ------------------------------------------------------------------
180 Class representing a manufactured radiation diffusion equation
181------------------------------------------------------------------ */
191{
192
193private:
194 // Constants that the maufactured solutions depends on.
195 constexpr static double kE0 = 2.0;
196 constexpr static double kT = 1.7;
197 constexpr static double kX = 1.5;
198 constexpr static double kXPhi = 0.245;
199 constexpr static double kY = 3.5;
200 constexpr static double kYPhi = 0.784;
201 constexpr static double kZ = 2.5;
202 constexpr static double kZPhi = 0.154;
203
204 //
205public:
206 Manufactured_RadDifModel( std::shared_ptr<AMP::Database> basic_db_,
207 std::shared_ptr<AMP::Database> specific_db_ );
208
210
211 double sourceTerm( size_t component, const AMP::Mesh::Point &point ) const override;
212
213 double initialCondition( size_t component, const AMP::Mesh::Point &point ) const override;
214
215 double exactSolution( size_t component, const AMP::Mesh::Point &point ) const override;
216
224 double getBoundaryFunctionValueE( size_t boundaryID, const AMP::Mesh::Point &point ) const;
225
233 double getBoundaryFunctionValueT( size_t boundaryID, const AMP::Mesh::Point &point ) const;
234
235 //
236private:
237 // Flag used inside exactSolution_ functions to determine whether to use the currentTime or 0.0
238 // when evaluating the function. This is a bit hacky, but allows for initialCondition to be a
239 // const function (without requiring currentTime to be mutable).
240 mutable bool d_settingInitialCondition = false;
241
243
245 void getNormalVector( size_t boundaryID, size_t &normalComponent, double &normalSign ) const;
246
248 double exactSolutionGradient( size_t component,
249 const AMP::Mesh::Point &point,
250 size_t gradComponent ) const;
251
252 // Exact solution, its gradient and corresponding source term
253 double exactSolution1D( size_t component, double x ) const;
254 double exactSolutionGradient1D( size_t component, double x ) const;
255 double sourceTerm1D( size_t component, double x ) const;
256 //
257 double exactSolution2D( size_t component, double x, double y ) const;
258 double
259 exactSolutionGradient2D( size_t component, double x, double y, size_t gradComponent ) const;
260 double sourceTerm2D( size_t component, double x, double y ) const;
261 //
262 double exactSolution3D( size_t component, double x, double y, double z ) const;
264 size_t component, double x, double y, double z, size_t gradComponent ) const;
265 double sourceTerm3D( size_t component, double x, double y, double z ) const;
266};
267
268
269} // namespace AMP::Operator
270
271#endif
double exactSolution3D(size_t component, double x, double y, double z) const
double exactSolutionGradient(size_t component, const AMP::Mesh::Point &point, size_t gradComponent) const
Dimension-agnostic wrapper around exactSolutionGradient_ functions.
double exactSolution(size_t component, const AMP::Mesh::Point &point) const override
Exact solution of PDE for given component at the given point.
double sourceTerm2D(size_t component, double x, double y) const
double exactSolutionGradient1D(size_t component, double x) const
double sourceTerm(size_t component, const AMP::Mesh::Point &point) const override
Solution-independent source term in PDE at the given point.
double exactSolutionGradient3D(size_t component, double x, double y, double z, size_t gradComponent) const
double initialCondition(size_t component, const AMP::Mesh::Point &point) const override
Initial condition of PDE at the given point.
double exactSolution1D(size_t component, double x) const
double getBoundaryFunctionValueT(size_t boundaryID, const AMP::Mesh::Point &point) const
double sourceTerm3D(size_t component, double x, double y, double z) const
double exactSolutionGradient2D(size_t component, double x, double y, size_t gradComponent) const
Manufactured_RadDifModel(std::shared_ptr< AMP::Database > basic_db_, std::shared_ptr< AMP::Database > specific_db_)
double exactSolution2D(size_t component, double x, double y) const
double getBoundaryFunctionValueE(size_t boundaryID, const AMP::Mesh::Point &point) const
void getNormalVector(size_t boundaryID, size_t &normalComponent, double &normalSign) const
Get component and sign of normal vector given the boundaryID.
double sourceTerm1D(size_t component, double x) const
double initialCondition(size_t component, const AMP::Mesh::Point &point) const override
Initial condition of PDE at the given point.
double sourceTerm(size_t component, const AMP::Mesh::Point &point) const override
Solution-independent source term in PDE at the given point.
Mousseau_etal_2000_RadDifModel(std::shared_ptr< AMP::Database > basic_db_, std::shared_ptr< AMP::Database > mspecific_db_)
static constexpr bool IsNonlinear
Flag indicating whether nonlinear or linear PDE coefficients are used.
virtual double exactSolution(size_t component, const AMP::Mesh::Point &point) const
Exact solution of PDE for given component at the given point.
virtual void finalizeGeneralPDEModel_db()=0
std::shared_ptr< AMP::Database > getRadiationDiffusionFD_input_db() const
Get database suitable for creating an instance of a RadDifOp.
bool d_exactSolutionAvailable
Does the derived class implement an exact solution?
virtual double sourceTerm(size_t component, const AMP::Mesh::Point &point) const =0
Solution-independent source term in PDE at the given point.
double diffusionCoefficientE(double T, double zatom) const
Energy diffusion coefficient D_E given temperature T.
double d_k11
Constant scaling factors in the PDE.
RadDifModel(std::shared_ptr< AMP::Database > basic_db_, std::shared_ptr< AMP::Database > mspecific_db_)
Constructor.
void setCurrentTime(double currentTime_)
Set current time of class.
bool d_RadiationDiffusionFD_input_db_completed
Flag derived classes must overwrite indicating they have constructed the above database.
virtual double initialCondition(size_t component, const AMP::Mesh::Point &point) const =0
Initial condition of PDE at the given point.
size_t d_dim
Shorthand for spatial dimension.
double getCurrentTime() const
Get current time of class (e.g., as may be used in sourceTerm)
double d_zatom
Atomic number; assumed constant.
bool exactSolutionAvailable() const
Does the derived class implement an exact solution?
std::shared_ptr< AMP::Database > d_mspecific_db
Parameters specific to a model.
std::shared_ptr< AMP::Database > d_RadiationDiffusionFD_input_db
Database of parameters required to create an instance of a RadiationDiffusionFD.
std::shared_ptr< AMP::Database > d_basic_db
Basic parameter database (with model-agnostic parameters)
double d_currentTime
The current time of the solution.



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page