11template <CubitBC BC>
struct RadiationBcType {};
13template <CubitBC BC>
struct GetRadiationParameters;
15template <>
struct GetRadiationParameters<
BLOCKSET> {
16 GetRadiationParameters() =
delete;
19 getParameters(
double &stefan_boltzmann_constant,
double &emissivity_parameter,
20 double &ambient_temperature, boost::shared_ptr<Range> &ents,
25 auto cubit_meshset_ptr =
26 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
28 std::vector<double> block_data;
29 CHKERR cubit_meshset_ptr->getAttributes(block_data);
30 if (block_data.size() < 3) {
32 "Expected that radiation block has three attributes "
33 "(Stefan–Boltzmann "
34 "constant, emissivity parameter, and ambient temperature)");
36 stefan_boltzmann_constant = block_data[0];
37 emissivity_parameter = block_data[1];
38 ambient_temperature = block_data[2];
42 <<
"Stefan–Boltzmann constant " << stefan_boltzmann_constant;
44 <<
"Emissivity parameter " << emissivity_parameter;
46 <<
"Ambient temperature " << ambient_temperature;
48 ents = boost::make_shared<Range>();
49 CHKERR m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
62template <AssemblyType A,
typename EleOp>
69 boost::shared_ptr<VectorDouble> t_ptr);
72 double stefanBoltzmanConstant;
73 double emmisivityParameter;
74 double ambientTemperature;
75 boost::shared_ptr<VectorDouble> tPtr;
79template <AssemblyType A,
typename EleOp>
86 std::string row_field_name, std::string col_field_name,
87 boost::shared_ptr<VectorDouble> t_ptr);
90 double stefanBoltzmanConstant;
91 double emmisivityParameter;
92 double ambientTemperature;
93 boost::shared_ptr<VectorDouble>
96 EntitiesFieldData::EntData &col_data);
99template <AssemblyType A,
typename EleOp>
100OpFluxRhsImpl<ThermoElasticOps::RadiationBcType<BLOCKSET>, 1, 1,
A,
GAUSS,
103 boost::shared_ptr<VectorDouble> t_ptr)
107 this->stefanBoltzmanConstant, this->emmisivityParameter,
108 this->ambientTemperature, this->entsPtr, m_field, ms_id, Sev::inform),
109 "Cannot read radiation data from blockset");
112template <AssemblyType A,
typename EleOp>
115 GAUSS,
EleOp>::iNtegrate(EntitiesFieldData::EntData
120 auto t_w = OpBase::getFTensor0IntegrationWeight();
122 auto t_row_base = row_data.getFTensor0N();
125 auto t_temp = getFTensor0FromVec(*tPtr);
128 const auto alpha = -t_w * (std::pow(
static_cast<double>(t_temp), 4) -
129 std::pow(ambientTemperature, 4));
145 auto t_normal = OpBase::getFTensor1Normal();
146 OpBase::locF *= t_normal.l2() * stefanBoltzmanConstant * emmisivityParameter;
148 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
149 if (fe_type == MBTRI) {
156template <AssemblyType A,
typename EleOp>
157OpFluxLhsImpl<ThermoElasticOps::RadiationBcType<BLOCKSET>, 1, 1,
A,
GAUSS,
159 std::string row_field_name,
160 std::string col_field_name,
161 boost::shared_ptr<VectorDouble> t_ptr)
162 :
OpBase(row_field_name, col_field_name,
OpBase::OPROWCOL), tPtr(t_ptr) {
168 this->stefanBoltzmanConstant, this->emmisivityParameter,
169 this->ambientTemperature, this->entsPtr, m_field, ms_id,
171 "Can not read radiation bc from blockset");
174template <AssemblyType A,
typename EleOp>
178 EleOp>::iNtegrate(EntitiesFieldData::EntData &row_data,
179 EntitiesFieldData::EntData &col_data) {
183 auto t_w = OpBase::getFTensor0IntegrationWeight();
185 auto t_row_base = row_data.getFTensor0N();
187 auto t_temp = getFTensor0FromVec(*tPtr);
190 const auto alpha = t_w * 4 * std::pow(
static_cast<double>(t_temp), 3);
196 const auto beta = alpha * t_row_base;
198 auto t_col_base = col_data.getFTensor0N(gg, 0);
210 auto t_normal = OpBase::getFTensor1Normal();
214 -t_normal.l2() * stefanBoltzmanConstant * emmisivityParameter;
216 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
217 if (fe_type == MBTRI) {
226struct AddFluxToRhsPipelineImpl<
234 AddFluxToRhsPipelineImpl() =
delete;
238 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
240 boost::shared_ptr<VectorDouble> T_ptr, std::string block_name, Sev sev
245 using OP = OpFluxRhsImpl<ThermoElasticOps::RadiationBcType<BLOCKSET>,
248 auto add_op = [&](
auto &&meshset_vec_ptr) {
249 for (
auto m : meshset_vec_ptr) {
261 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
264 (boost::format(
"%s(.*)") % block_name).str()
273 "Handling of bc type not implemented");
282struct AddFluxToLhsPipelineImpl<
290 AddFluxToLhsPipelineImpl() =
delete;
294 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
296 std::string col_field_name, boost::shared_ptr<VectorDouble> T_ptr,
297 std::string block_name, Sev sev
302 using OP = OpFluxLhsImpl<ThermoElasticOps::RadiationBcType<BLOCKSET>,
305 auto add_op = [&](
auto &&meshset_vec_ptr) {
306 for (
auto m : meshset_vec_ptr) {
308 pipeline.push_back(
new OP(m_field,
m->getMeshsetId(), row_field_name,
309 col_field_name, T_ptr));
318 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
321 (boost::format(
"%s(.*)") % block_name).str()
330 "Handling of bc type not implemented");
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
CubitBC
Types of sets and boundary conditions.
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
constexpr IntegrationType I
constexpr AssemblyType A
[Define dimension]
constexpr auto field_name
FTensor::Index< 'm', 3 > m
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
Deprecated interface functions.
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
MatrixDouble locMat
local entity block matrix
int nbCols
number if dof on column
int nbRowBaseFunctions
number or row base functions
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.