19 double &ambient_temperature,
20 boost::shared_ptr<Range> &ents,
26 auto cubit_meshset_ptr =
27 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
29 std::vector<double> block_data;
30 CHKERR cubit_meshset_ptr->getAttributes(block_data);
31 if (block_data.size() < 2) {
33 "Expected that convection block has two attributes (heat "
34 "transfer coefficient and ambient temperature)");
36 heat_transfer_coefficient = block_data[0];
37 ambient_temperature = block_data[1];
41 <<
"Heat transfer coefficient " << heat_transfer_coefficient;
43 <<
"Ambient temperature " << ambient_temperature;
45 ents = boost::make_shared<Range>();
47 m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
60template <AssemblyType A,
typename EleOp>
67 boost::shared_ptr<VectorDouble> t_ptr,
68 std::vector<boost::shared_ptr<ScalingMethod>> smv);
73 boost::shared_ptr<VectorDouble>
tPtr;
75 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &data);
78template <AssemblyType A,
typename EleOp>
85 std::string row_field_name, std::string col_field_name);
90 MoFEMErrorCode
iNtegrate(EntitiesFieldData::EntData &row_data,
91 EntitiesFieldData::EntData &col_data);
94template <AssemblyType A,
typename EleOp>
99 boost::shared_ptr<VectorDouble> t_ptr,
100 std::vector<boost::shared_ptr<ScalingMethod>> smv)
102 vecOfTimeScalingMethods(smv) {
105 this->heatTransferCoefficient, this->ambientTemperature,
106 this->entsPtr, m_field, ms_id, Sev::inform),
107 "Cannot read convection data from blockset");
110template <AssemblyType A,
typename EleOp>
113 GAUSS,
EleOp>::iNtegrate(EntitiesFieldData::EntData
118 auto t_w = OpBase::getFTensor0IntegrationWeight();
120 auto t_row_base = row_data.getFTensor0N();
122 auto t_temp = getFTensor0FromVec(*tPtr);
125 for (
auto &o : vecOfTimeScalingMethods) {
126 s *= o->getScale(OpBase::getTStime());
132 -t_w * heatTransferCoefficient * (t_temp - ambientTemperature * s);
147 auto t_normal = OpBase::getFTensor1Normal();
150 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
151 if (fe_type == MBTRI) {
158template <AssemblyType A,
typename EleOp>
159OpFluxLhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>, 1, 1,
A,
GAUSS,
161 std::string row_field_name,
162 std::string col_field_name)
163 :
OpBase(row_field_name, col_field_name,
OpBase::OPROWCOL) {
169 this->heatTransferCoefficient, this->ambientTemperature,
170 this->entsPtr, m_field, ms_id, Sev::verbose),
171 "Cannot read convection data 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();
191 const auto alpha = t_w * t_row_base;
193 auto t_col_base = col_data.getFTensor0N(gg, 0);
206 auto t_normal = OpBase::getFTensor1Normal();
211 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
212 if (fe_type == MBTRI) {
221struct AddFluxToRhsPipelineImpl<
231 static MoFEMErrorCode
add(
233 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
235 boost::shared_ptr<VectorDouble> u_ptr,
236 std::vector<boost::shared_ptr<ScalingMethod>> smv, std::string block_name,
242 using OP = OpFluxRhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>,
245 auto add_op = [&](
auto &&meshset_vec_ptr) {
246 for (
auto m : meshset_vec_ptr) {
258 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
261 (boost::format(
"%s(.*)") % block_name).str()
270 "Handling of bc type not implemented");
279struct AddFluxToLhsPipelineImpl<
289 static MoFEMErrorCode
add(
291 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
293 std::string col_field_name, std::string block_name, Sev sev
298 using OP = OpFluxLhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>,
301 auto add_op = [&](
auto &&meshset_vec_ptr) {
302 for (
auto m : meshset_vec_ptr) {
305 new OP(m_field,
m->getMeshsetId(), row_field_name, col_field_name));
314 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
317 (boost::format(
"%s(.*)") % block_name).str()
326 "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