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 auto *json_config = m_field.
getInterface<JsonConfigManager>();
29 const auto params_from_json =
30 json_config->getParamsFromBlockset(
"RADIATION", ms_id);
31 if (!params_from_json.empty()) {
32 stefan_boltzmann_constant =
33 params_from_json.at(
"stefan_boltzmann_constant");
34 emissivity_parameter = params_from_json.at(
"emissivity");
35 ambient_temperature = params_from_json.at(
"ambient_temperature");
37 std::vector<double> block_data;
38 CHKERR cubit_meshset_ptr->getAttributes(block_data);
39 if (block_data.size() < 3) {
41 "Expected that radiation block has three attributes "
42 "(Stefan–Boltzmann "
43 "constant, emissivity parameter, and ambient temperature)");
45 stefan_boltzmann_constant = block_data[0];
46 emissivity_parameter = block_data[1];
47 ambient_temperature = block_data[2];
52 <<
"Stefan–Boltzmann constant " << stefan_boltzmann_constant;
54 <<
"Emissivity parameter " << emissivity_parameter;
56 <<
"Ambient temperature " << ambient_temperature;
58 ents = boost::make_shared<Range>();
59 CHKERR m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
72template <AssemblyType A,
typename EleOp>
79 boost::shared_ptr<VectorDouble> t_ptr,
80 std::vector<boost::shared_ptr<ScalingMethod>> smv);
86 boost::shared_ptr<VectorDouble>
tPtr;
88 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &data);
91template <AssemblyType A,
typename EleOp>
98 std::string row_field_name, std::string col_field_name,
99 boost::shared_ptr<VectorDouble> t_ptr);
105 boost::shared_ptr<VectorDouble>
107 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &row_data,
108 EntitiesFieldData::EntData &col_data);
111template <AssemblyType A,
typename EleOp>
116 boost::shared_ptr<VectorDouble> t_ptr,
117 std::vector<boost::shared_ptr<ScalingMethod>> smv)
119 vecOfTimeScalingMethods(smv) {
122 this->stefanBoltzmanConstant, this->emmisivityParameter,
123 this->ambientTemperature, this->entsPtr, m_field, ms_id, Sev::inform),
124 "Cannot read radiation data from blockset");
127template <AssemblyType A,
typename EleOp>
130 GAUSS,
EleOp>::iNtegrate(EntitiesFieldData::EntData
135 auto t_w = OpBase::getFTensor0IntegrationWeight();
137 auto t_row_base = row_data.getFTensor0N();
139 auto t_temp = getFTensor0FromVec(*tPtr);
142 for (
auto &o : vecOfTimeScalingMethods) {
143 s *= o->getScale(OpBase::getTStime());
148 const auto alpha = -t_w * (std::pow(
static_cast<double>(t_temp), 4) -
149 std::pow(ambientTemperature * s, 4));
165 auto t_normal = OpBase::getFTensor1Normal();
166 OpBase::locF *= t_normal.l2() * stefanBoltzmanConstant * emmisivityParameter;
168 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
169 if (fe_type == MBTRI) {
176template <AssemblyType A,
typename EleOp>
177OpFluxLhsImpl<ThermoElasticOps::RadiationBcType<BLOCKSET>, 1, 1,
A,
GAUSS,
179 std::string row_field_name,
180 std::string col_field_name,
181 boost::shared_ptr<VectorDouble> t_ptr)
182 :
OpBase(row_field_name, col_field_name,
OpBase::OPROWCOL), tPtr(t_ptr) {
188 this->stefanBoltzmanConstant, this->emmisivityParameter,
189 this->ambientTemperature, this->entsPtr, m_field, ms_id,
191 "Can not read radiation bc from blockset");
194template <AssemblyType A,
typename EleOp>
198 EleOp>::iNtegrate(EntitiesFieldData::EntData &row_data,
199 EntitiesFieldData::EntData &col_data) {
203 auto t_w = OpBase::getFTensor0IntegrationWeight();
205 auto t_row_base = row_data.getFTensor0N();
207 auto t_temp = getFTensor0FromVec(*tPtr);
210 const auto alpha = t_w * 4 * std::pow(
static_cast<double>(t_temp), 3);
216 const auto beta = alpha * t_row_base;
218 auto t_col_base = col_data.getFTensor0N(gg, 0);
230 auto t_normal = OpBase::getFTensor1Normal();
234 -t_normal.l2() * stefanBoltzmanConstant * emmisivityParameter;
236 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
237 if (fe_type == MBTRI) {
246struct AddFluxToRhsPipelineImpl<
256 static MoFEMErrorCode
add(
258 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
260 boost::shared_ptr<VectorDouble> T_ptr,
261 std::vector<boost::shared_ptr<ScalingMethod>> smv, std::string block_name,
267 using OP = OpFluxRhsImpl<ThermoElasticOps::RadiationBcType<BLOCKSET>,
270 auto add_op = [&](
auto &&meshset_vec_ptr) {
271 for (
auto m : meshset_vec_ptr) {
283 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
286 (boost::format(
"%s(.*)") % block_name).str()
295 "Handling of bc type not implemented");
304struct AddFluxToLhsPipelineImpl<
314 static MoFEMErrorCode
add(
316 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
318 std::string col_field_name, boost::shared_ptr<VectorDouble> T_ptr,
319 std::string block_name, Sev sev
324 using OP = OpFluxLhsImpl<ThermoElasticOps::RadiationBcType<BLOCKSET>,
327 auto add_op = [&](
auto &&meshset_vec_ptr) {
328 for (
auto m : meshset_vec_ptr) {
330 pipeline.push_back(
new OP(m_field,
m->getMeshsetId(), row_field_name,
331 col_field_name, T_ptr));
340 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
343 (boost::format(
"%s(.*)") % block_name).str()
352 "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.
constexpr IntegrationType I
constexpr auto field_name
FTensor::Index< 'm', 3 > m
static MoFEMErrorCode add(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, MoFEM::Interface &m_field, std::string row_field_name, std::string col_field_name, boost::shared_ptr< VectorDouble > T_ptr, std::string block_name, Sev sev)
AddFluxToLhsPipelineImpl()=delete
AddFluxToRhsPipelineImpl()=delete
static MoFEMErrorCode add(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, MoFEM::Interface &m_field, std::string field_name, boost::shared_ptr< VectorDouble > T_ptr, std::vector< boost::shared_ptr< ScalingMethod > > smv, std::string block_name, Sev sev)
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.
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
double emmisivityParameter
double stefanBoltzmanConstant
boost::shared_ptr< VectorDouble > tPtr
double ambientTemperature
double ambientTemperature
double stefanBoltzmanConstant
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
boost::shared_ptr< VectorDouble > tPtr
std::vector< boost::shared_ptr< ScalingMethod > > vecOfTimeScalingMethods
double emmisivityParameter
GetRadiationParameters()=delete
static MoFEMErrorCode getParameters(double &stefan_boltzmann_constant, double &emissivity_parameter, double &ambient_temperature, boost::shared_ptr< Range > &ents, MoFEM::Interface &m_field, int ms_id, Sev sev)