19 double &ambient_temperature,
20 boost::shared_ptr<Range> &ents,
26 auto cubit_meshset_ptr =
27 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
29 auto *json_config = m_field.
getInterface<JsonConfigManager>();
30 const auto params_from_json =
31 json_config->getParamsFromBlockset(
"CONVECTION", ms_id);
32 if (!params_from_json.empty()) {
33 heat_transfer_coefficient = params_from_json.at(
"heat_transfer_coefficient");
34 ambient_temperature = params_from_json.at(
"ambient_temperature");
36 std::vector<double> block_data;
37 CHKERR cubit_meshset_ptr->getAttributes(block_data);
38 if (block_data.size() < 2) {
40 "Expected that convection block has two attributes (heat "
41 "transfer coefficient and ambient temperature)");
43 heat_transfer_coefficient = block_data[0];
44 ambient_temperature = block_data[1];
49 <<
"Heat transfer coefficient " << heat_transfer_coefficient;
51 <<
"Ambient temperature " << ambient_temperature;
53 ents = boost::make_shared<Range>();
55 m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
68template <AssemblyType A,
typename EleOp>
75 boost::shared_ptr<VectorDouble> t_ptr,
76 std::vector<boost::shared_ptr<ScalingMethod>> smv);
81 boost::shared_ptr<VectorDouble>
tPtr;
83 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &data);
86template <AssemblyType A,
typename EleOp>
93 std::string row_field_name, std::string col_field_name);
98 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &row_data,
99 EntitiesFieldData::EntData &col_data);
102template <AssemblyType A,
typename EleOp>
107 boost::shared_ptr<VectorDouble> t_ptr,
108 std::vector<boost::shared_ptr<ScalingMethod>> smv)
110 vecOfTimeScalingMethods(smv) {
113 this->heatTransferCoefficient, this->ambientTemperature,
114 this->entsPtr, m_field, ms_id, Sev::inform),
115 "Cannot read convection data from blockset");
118template <AssemblyType A,
typename EleOp>
121 GAUSS,
EleOp>::iNtegrate(EntitiesFieldData::EntData
126 auto t_w = OpBase::getFTensor0IntegrationWeight();
128 auto t_row_base = row_data.getFTensor0N();
130 auto t_temp = getFTensor0FromVec(*tPtr);
133 for (
auto &o : vecOfTimeScalingMethods) {
134 s *= o->getScale(OpBase::getTStime());
140 -t_w * heatTransferCoefficient * (t_temp - ambientTemperature * s);
155 auto t_normal = OpBase::getFTensor1Normal();
158 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
159 if (fe_type == MBTRI) {
166template <AssemblyType A,
typename EleOp>
167OpFluxLhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>, 1, 1,
A,
GAUSS,
169 std::string row_field_name,
170 std::string col_field_name)
171 :
OpBase(row_field_name, col_field_name,
OpBase::OPROWCOL) {
177 this->heatTransferCoefficient, this->ambientTemperature,
178 this->entsPtr, m_field, ms_id, Sev::verbose),
179 "Cannot read convection data from blockset");
182template <AssemblyType A,
typename EleOp>
186 EleOp>::iNtegrate(EntitiesFieldData::EntData &row_data,
187 EntitiesFieldData::EntData &col_data) {
191 auto t_w = OpBase::getFTensor0IntegrationWeight();
193 auto t_row_base = row_data.getFTensor0N();
199 const auto alpha = t_w * t_row_base;
201 auto t_col_base = col_data.getFTensor0N(gg, 0);
214 auto t_normal = OpBase::getFTensor1Normal();
219 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
220 if (fe_type == MBTRI) {
229struct AddFluxToRhsPipelineImpl<
239 static MoFEMErrorCode
add(
241 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
243 boost::shared_ptr<VectorDouble> u_ptr,
244 std::vector<boost::shared_ptr<ScalingMethod>> smv, std::string block_name,
250 using OP = OpFluxRhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>,
253 auto add_op = [&](
auto &&meshset_vec_ptr) {
254 for (
auto m : meshset_vec_ptr) {
266 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
269 (boost::format(
"%s(.*)") % block_name).str()
278 "Handling of bc type not implemented");
287struct AddFluxToLhsPipelineImpl<
297 static MoFEMErrorCode
add(
299 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
301 std::string col_field_name, std::string block_name, Sev sev
306 using OP = OpFluxLhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>,
309 auto add_op = [&](
auto &&meshset_vec_ptr) {
310 for (
auto m : meshset_vec_ptr) {
313 new OP(m_field,
m->getMeshsetId(), row_field_name, col_field_name));
322 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
325 (boost::format(
"%s(.*)") % block_name).str()
334 "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
AddFluxToLhsPipelineImpl()=delete
static MoFEMErrorCode add(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, MoFEM::Interface &m_field, std::string row_field_name, std::string col_field_name, std::string block_name, Sev sev)
AddFluxToRhsPipelineImpl()=delete
static MoFEMErrorCode add(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, MoFEM::Interface &m_field, std::string field_name, boost::shared_ptr< VectorDouble > u_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.
double ambientTemperature
double heatTransferCoefficient
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
double ambientTemperature
boost::shared_ptr< VectorDouble > tPtr
double heatTransferCoefficient
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
std::vector< boost::shared_ptr< ScalingMethod > > vecOfTimeScalingMethods
static MoFEMErrorCode getParameters(double &heat_transfer_coefficient, double &ambient_temperature, boost::shared_ptr< Range > &ents, MoFEM::Interface &m_field, int ms_id, Sev sev)
GetConvectionParameters()=delete