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,
70 std::vector<boost::shared_ptr<ScalingMethod>> smv);
76 boost::shared_ptr<VectorDouble>
tPtr;
78 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &data);
81template <AssemblyType A,
typename EleOp>
88 std::string row_field_name, std::string col_field_name,
89 boost::shared_ptr<VectorDouble> t_ptr);
95 boost::shared_ptr<VectorDouble>
97 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &row_data,
98 EntitiesFieldData::EntData &col_data);
101template <AssemblyType A,
typename EleOp>
106 boost::shared_ptr<VectorDouble> t_ptr,
107 std::vector<boost::shared_ptr<ScalingMethod>> smv)
109 vecOfTimeScalingMethods(smv) {
112 this->stefanBoltzmanConstant, this->emmisivityParameter,
113 this->ambientTemperature, this->entsPtr, m_field, ms_id, Sev::inform),
114 "Cannot read radiation data from blockset");
117template <AssemblyType A,
typename EleOp>
120 GAUSS,
EleOp>::iNtegrate(EntitiesFieldData::EntData
125 auto t_w = OpBase::getFTensor0IntegrationWeight();
127 auto t_row_base = row_data.getFTensor0N();
129 auto t_temp = getFTensor0FromVec(*tPtr);
132 for (
auto &o : vecOfTimeScalingMethods) {
133 s *= o->getScale(OpBase::getTStime());
138 const auto alpha = -t_w * (std::pow(
static_cast<double>(t_temp), 4) -
139 std::pow(ambientTemperature * s, 4));
155 auto t_normal = OpBase::getFTensor1Normal();
156 OpBase::locF *= t_normal.l2() * stefanBoltzmanConstant * emmisivityParameter;
158 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
159 if (fe_type == MBTRI) {
166template <AssemblyType A,
typename EleOp>
167OpFluxLhsImpl<ThermoElasticOps::RadiationBcType<BLOCKSET>, 1, 1,
A,
GAUSS,
169 std::string row_field_name,
170 std::string col_field_name,
171 boost::shared_ptr<VectorDouble> t_ptr)
172 :
OpBase(row_field_name, col_field_name,
OpBase::OPROWCOL), tPtr(t_ptr) {
178 this->stefanBoltzmanConstant, this->emmisivityParameter,
179 this->ambientTemperature, this->entsPtr, m_field, ms_id,
181 "Can not read radiation bc from blockset");
184template <AssemblyType A,
typename EleOp>
188 EleOp>::iNtegrate(EntitiesFieldData::EntData &row_data,
189 EntitiesFieldData::EntData &col_data) {
193 auto t_w = OpBase::getFTensor0IntegrationWeight();
195 auto t_row_base = row_data.getFTensor0N();
197 auto t_temp = getFTensor0FromVec(*tPtr);
200 const auto alpha = t_w * 4 * std::pow(
static_cast<double>(t_temp), 3);
206 const auto beta = alpha * t_row_base;
208 auto t_col_base = col_data.getFTensor0N(gg, 0);
220 auto t_normal = OpBase::getFTensor1Normal();
224 -t_normal.l2() * stefanBoltzmanConstant * emmisivityParameter;
226 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
227 if (fe_type == MBTRI) {
236struct AddFluxToRhsPipelineImpl<
246 static MoFEMErrorCode
add(
248 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
250 boost::shared_ptr<VectorDouble> T_ptr,
251 std::vector<boost::shared_ptr<ScalingMethod>> smv, std::string block_name,
257 using OP = OpFluxRhsImpl<ThermoElasticOps::RadiationBcType<BLOCKSET>,
260 auto add_op = [&](
auto &&meshset_vec_ptr) {
261 for (
auto m : meshset_vec_ptr) {
273 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
276 (boost::format(
"%s(.*)") % block_name).str()
285 "Handling of bc type not implemented");
294struct AddFluxToLhsPipelineImpl<
304 static MoFEMErrorCode
add(
306 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
308 std::string col_field_name, boost::shared_ptr<VectorDouble> T_ptr,
309 std::string block_name, Sev sev
314 using OP = OpFluxLhsImpl<ThermoElasticOps::RadiationBcType<BLOCKSET>,
317 auto add_op = [&](
auto &&meshset_vec_ptr) {
318 for (
auto m : meshset_vec_ptr) {
320 pipeline.push_back(
new OP(m_field,
m->getMeshsetId(), row_field_name,
321 col_field_name, T_ptr));
330 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
333 (boost::format(
"%s(.*)") % block_name).str()
342 "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)