22 double &ambient_temperature,
23 boost::shared_ptr<Range> &ents,
29 auto cubit_meshset_ptr =
30 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
32 std::vector<double> block_data;
33 CHKERR cubit_meshset_ptr->getAttributes(block_data);
34 if (block_data.size() < 2) {
36 "Expected that convection block has two attributes (heat "
37 "transfer coefficient and ambient temperature)");
39 heat_transfer_coefficient = block_data[0];
40 ambient_temperature = block_data[1];
44 <<
"Heat transfer coefficient " << heat_transfer_coefficient;
46 <<
"Ambient temperature " << ambient_temperature;
48 ents = boost::make_shared<Range>();
50 m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
63 template <AssemblyType A,
typename EleOp>
70 boost::shared_ptr<VectorDouble> t_ptr);
75 boost::shared_ptr<VectorDouble>
tPtr;
79 template <AssemblyType A,
typename EleOp>
86 std::string row_field_name, std::string col_field_name);
95 template <AssemblyType A,
typename EleOp>
96 OpFluxRhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>, 1, 1,
A,
GAUSS,
99 boost::shared_ptr<VectorDouble> t_ptr)
103 this->heatTransferCoefficient, this->ambientTemperature,
104 this->entsPtr, m_field, ms_id, Sev::inform),
105 "Cannot read convection data from blockset");
108 template <AssemblyType A,
typename EleOp>
116 auto t_w = OpBase::getFTensor0IntegrationWeight();
118 auto t_row_base = row_data.getFTensor0N();
125 -t_w * heatTransferCoefficient * (t_temp - ambientTemperature);
140 auto t_normal = OpBase::getFTensor1Normal();
143 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
144 if (fe_type == MBTRI) {
151 template <AssemblyType A,
typename EleOp>
152 OpFluxLhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>, 1, 1,
A,
GAUSS,
154 std::string row_field_name,
155 std::string col_field_name)
156 :
OpBase(row_field_name, col_field_name,
OpBase::OPROWCOL) {
162 this->heatTransferCoefficient, this->ambientTemperature,
163 this->entsPtr, m_field, ms_id, Sev::verbose),
164 "Cannot read convection data from blockset");
167 template <AssemblyType A,
typename EleOp>
176 const double vol = OpBase::getMeasure();
178 auto t_w = OpBase::getFTensor0IntegrationWeight();
180 auto t_row_base = row_data.getFTensor0N();
186 const auto alpha = t_w * t_row_base;
188 auto t_col_base = col_data.getFTensor0N(gg, 0);
201 auto t_normal = OpBase::getFTensor1Normal();
206 EntityType fe_type = OpBase::getNumeredEntFiniteElementPtr()->getEntType();
207 if (fe_type == MBTRI) {
216 struct AddFluxToRhsPipelineImpl<
224 AddFluxToRhsPipelineImpl() =
delete;
228 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
230 boost::shared_ptr<VectorDouble> u_ptr, std::string block_name,
Sev sev
235 using OP = OpFluxRhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>,
238 auto add_op = [&](
auto &&meshset_vec_ptr) {
239 for (
auto m : meshset_vec_ptr) {
251 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
254 (boost::format(
"%s(.*)") % block_name).str()
263 "Handling of bc type not implemented");
272 struct AddFluxToLhsPipelineImpl<
280 AddFluxToLhsPipelineImpl() =
delete;
284 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
286 std::string col_field_name, std::string block_name,
Sev sev
291 using OP = OpFluxLhsImpl<ThermoElasticOps::ConvectionBcType<BLOCKSET>,
294 auto add_op = [&](
auto &&meshset_vec_ptr) {
295 for (
auto m : meshset_vec_ptr) {
298 new OP(m_field,
m->getMeshsetId(), row_field_name, col_field_name));
307 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
310 (boost::format(
"%s(.*)") % block_name).str()
319 "Handling of bc type not implemented");