v0.14.0
Loading...
Searching...
No Matches
ThermalElement.hpp
Go to the documentation of this file.
1/** \file ThermalElement.hpp
2 \ingroup mofem_thermal_elem
3
4 \brief Operators and data structures for thermal analysis
5
6 Implementation of thermal element for unsteady and steady case.
7 Radiation and convection blocks implemented by Xuan Meng
8
9*/
10
11
12
13#ifndef __THERMAL_ELEMENT_HPP
14#define __THERMAL_ELEMENT_HPP
15
16/** \brief structure grouping operators and data used for thermal problems
17 * \ingroup mofem_thermal_elem
18 *
19 * In order to assemble matrices and right hand vectors, the loops over
20 * elements, entities within the element and finally loop over integration
21 * points are executed.
22 *
23 * Following implementation separate those three types of loops and to each
24 * loop attach operator.
25 *
26 */
28
29 /// \brief definition of volume element
33
34 /** \brief it is used to calculate nb. of Gauss integration points
35 *
36 * for more details pleas look
37 * Reference:
38 *
39 * Albert Nijenhuis, Herbert Wilf,
40 * Combinatorial Algorithms for Computers and Calculators,
41 * Second Edition,
42 * Academic Press, 1978,
43 * ISBN: 0-12-519260-6,
44 * LC: QA164.N54.
45 *
46 * More details about algorithm
47 * http://people.sc.fsu.edu/~jburkardt/cpp_src/gm_rule/gm_rule.html
48 **/
49 int getRule(int order) { return 2 * (order - 1); };
50 };
51 MyVolumeFE feRhs; ///< cauclate right hand side for tetrahedral elements
52 MyVolumeFE &getLoopFeRhs() { return feRhs; } ///< get rhs volume element
53 MyVolumeFE feLhs; //< calculate left hand side for tetrahedral elements
54 MyVolumeFE &getLoopFeLhs() { return feLhs; } ///< get lhs volume element
55
56 /** \brief define surface element
57 *
58 * This element is used to integrate heat fluxes; convection and radiation
59 */
63 int getRule(int order) { return 2 * order; };
64 };
65
66 MyTriFE feFlux; //< heat flux element
67 MyTriFE &getLoopFeFlux() { return feFlux; } //< get heat flux element
68
69 MyTriFE feConvectionRhs; //< convection element
72 return feConvectionRhs;
73 } //< get convection element
75
76 MyTriFE feRadiationRhs; //< radiation element
79 return feRadiationRhs;
80 } //< get radiation element
82
85 : feRhs(m_field), feLhs(m_field), feFlux(m_field),
86 feConvectionRhs(m_field), feConvectionLhs(m_field),
87 feRadiationRhs(m_field), feRadiationLhs(m_field), mField(m_field) {}
88
89 /** \brief data for calculation heat conductivity and heat capacity elements
90 * \ingroup mofem_thermal_elem
91 */
92 struct BlockData {
93 // double cOnductivity;
94 MatrixDouble cOnductivity_mat; // This is (3x3) conductivity matrix
95 double cApacity; // rou * c_p == material density multiple heat capacity
96 double initTemp; ///< initial temperature
97 Range tEts; ///< contains elements in block set
98 };
99 std::map<int, BlockData>
100 setOfBlocks; ///< maps block set id with appropriate BlockData
101
102 /** \brief data for calculation heat flux
103 * \ingroup mofem_thermal_elem
104 */
105 struct FluxData {
106 HeatFluxCubitBcData dAta; ///< for more details look to BCMultiIndices.hpp
107 ///< to see details of HeatFluxCubitBcData
108 Range tRis; ///< surface triangles where hate flux is applied
109 };
110 std::map<int, FluxData>
111 setOfFluxes; ///< maps side set id with appropriate FluxData
112
113 /** \brief data for convection
114 * \ingroup mofem_thermal_elem
115 */
117 double cOnvection; /*The summation of Convection coefficients*/
118 double tEmperature; /*Ambient temperature of the area contains the black
119 body */
120 Range tRis; ///< those will be on body skin, except this with contact with
121 ///< other body where temperature is applied
122 };
123 std::map<int, ConvectionData>
124 setOfConvection; //< maps block set id with appropriate data
125
126 /** \brief data for radiation
127 * \ingroup mofem_thermal_elem
128 */
130 double sIgma; /* The Stefan-Boltzmann constant*/
131 double eMissivity; /* The surface emissivity coefficients range = [0,1] */
132 // double aBsorption; /* The surface absorption coefficients */
133 double aMbienttEmp; /* The incident radiant heat flow per unit surface area;
134 or the ambient temperature of space*/
135 Range tRis; ///< those will be on body skin, except this with contact with
136 ///< other body where temperature is applied
137 };
138 std::map<int, RadiationData>
139 setOfRadiation; //< maps block set id with appropriate data
140
141 /** \brief common data used by volume elements
142 * \ingroup mofem_thermal_elem
143 */
144 struct CommonData {
147 MatrixDouble gradAtGaussPts;
148 inline ublas::matrix_row<MatrixDouble> getGradAtGaussPts(const int gg) {
149 return ublas::matrix_row<MatrixDouble>(gradAtGaussPts, gg);
150 }
151 };
153
154 /// \brief operator to calculate temperature gradient at Gauss points
157
159 OpGetGradAtGaussPts(const std::string field_name, CommonData &common_data)
160 : MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
162 commonData(common_data) {}
163
164 /** \brief operator calculating temperature gradients
165 *
166 * temperature gradient is calculated multiplying derivatives of shape
167 * functions by degrees of freedom.
168 */
169 MoFEMErrorCode doWork(int side, EntityType type,
170 EntitiesFieldData::EntData &data);
171 };
172
173 /** \brief operator to calculate temperature and rate of temperature at Gauss
174 * points \ingroup mofem_thermal_elem
175 */
176 template <typename OP>
177 struct OpGetFieldAtGaussPts : public OP::UserDataOperator {
178
179 VectorDouble &fieldAtGaussPts;
181 VectorDouble &field_at_gauss_pts)
183 fieldAtGaussPts(field_at_gauss_pts) {}
184
185 /** \brief operator calculating temperature and rate of temperature
186 *
187 * temperature temperature or rate of temperature is calculated multiplying
188 * shape functions by degrees of freedom
189 */
190 MoFEMErrorCode doWork(int side, EntityType type,
191 EntitiesFieldData::EntData &data) {
193 try {
194
195 if (data.getFieldData().size() == 0)
197 int nb_dofs = data.getFieldData().size();
198 int nb_gauss_pts = data.getN().size1();
199
200 // initialize
201 fieldAtGaussPts.resize(nb_gauss_pts);
202 if (type == MBVERTEX) {
203 // loop over shape functions on entities always start from
204 // vertices, so if nodal shape functions are processed, vector of
205 // field values is zero at initialization
206 std::fill(fieldAtGaussPts.begin(), fieldAtGaussPts.end(), 0);
207 }
208
209 for (int gg = 0; gg < nb_gauss_pts; gg++) {
210 fieldAtGaussPts[gg] +=
211 inner_prod(data.getN(gg, nb_dofs), data.getFieldData());
212 }
213
214 } catch (const std::exception &ex) {
215 std::ostringstream ss;
216 ss << "throw in method: " << ex.what() << std::endl;
217 SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, ss.str().c_str());
218 }
219
221 }
222 };
223
224 /** \brief operator to calculate temperature at Gauss pts
225 * \ingroup mofem_thermal_elem
226 */
228 : public OpGetFieldAtGaussPts<MoFEM::VolumeElementForcesAndSourcesCore> {
230 CommonData &common_data)
231 : OpGetFieldAtGaussPts<MoFEM::VolumeElementForcesAndSourcesCore>(
232 field_name, common_data.temperatureAtGaussPts) {}
233 };
234
235 /** \brief operator to calculate temperature at Gauss pts
236 * \ingroup mofem_thermal_elem
237 */
239 : public OpGetFieldAtGaussPts<MoFEM::FaceElementForcesAndSourcesCore> {
241 CommonData &common_data)
243 field_name, common_data.temperatureAtGaussPts) {}
244 };
245
246 /** \brief operator to calculate temperature rate at Gauss pts
247 * \ingroup mofem_thermal_elem
248 */
250 : public OpGetFieldAtGaussPts<MoFEM::VolumeElementForcesAndSourcesCore> {
252 CommonData &common_data)
253 : OpGetFieldAtGaussPts<MoFEM::VolumeElementForcesAndSourcesCore>(
254 field_name, common_data.temperatureRateAtGaussPts) {}
255 };
256
257 /** \biref operator to calculate right hand side of heat conductivity terms
258 * \ingroup mofem_thermal_elem
259 */
262
265 bool useTsF;
266 OpThermalRhs(const std::string field_name, BlockData &data,
267 CommonData &common_data)
268 : MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
270 dAta(data), commonData(common_data), useTsF(true) {}
271
272 Vec F;
273 OpThermalRhs(const std::string field_name, Vec _F, BlockData &data,
274 CommonData &common_data)
275 : MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
277 dAta(data), commonData(common_data), useTsF(false), F(_F) {}
278
279 VectorDouble Nf;
280
281 /** \brief calculate thermal conductivity matrix
282 *
283 * F = int diffN^T k gard_T dOmega^2
284 *
285 */
286 MoFEMErrorCode doWork(int side, EntityType type,
287 EntitiesFieldData::EntData &data);
288 };
289
290 /** \biref operator to calculate left hand side of heat conductivity terms
291 * \ingroup mofem_thermal_elem
292 */
295
298 bool useTsB;
299 OpThermalLhs(const std::string field_name, BlockData &data,
300 CommonData &common_data)
301 : MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
303 dAta(data), commonData(common_data), useTsB(true) {}
304
305 Mat A;
306 OpThermalLhs(const std::string field_name, Mat _A, BlockData &data,
307 CommonData &common_data)
308 : MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
310 dAta(data), commonData(common_data), useTsB(false), A(_A) {}
311
312 MatrixDouble K, transK;
313
314 /** \brief calculate thermal conductivity matrix
315 *
316 * K = int diffN^T k diffN^T dOmega^2
317 *
318 */
319 MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
320 EntityType col_type,
321 EntitiesFieldData::EntData &row_data,
322 EntitiesFieldData::EntData &col_data);
323 };
324
325 /** \brief operator to calculate right hand side of heat capacity terms
326 * \ingroup mofem_thermal_elem
327 */
330
333 OpHeatCapacityRhs(const std::string field_name, BlockData &data,
334 CommonData &common_data)
335 : MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
337 dAta(data), commonData(common_data) {}
338
339 VectorDouble Nf;
340
341 /** \brief calculate thermal conductivity matrix
342 *
343 * F = int N^T c (dT/dt) dOmega^2
344 *
345 */
346 MoFEMErrorCode doWork(int side, EntityType type,
347 EntitiesFieldData::EntData &data);
348 };
349
350 /** \brief operator to calculate left hand side of heat capacity terms
351 * \ingroup mofem_thermal_elem
352 */
355
358 OpHeatCapacityLhs(const std::string field_name, BlockData &data,
359 CommonData &common_data)
360 : MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
362 dAta(data), commonData(common_data) {}
363
364 MatrixDouble M, transM;
365
366 /** \brief calculate heat capacity matrix
367 *
368 * M = int N^T c N dOmega^2
369 *
370 */
371 MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
372 EntityType col_type,
373 EntitiesFieldData::EntData &row_data,
374 EntitiesFieldData::EntData &col_data);
375 };
376
377 /** \brief operator for calculate heat flux and assemble to right hand side
378 * \ingroup mofem_thermal_elem
379 */
382
385 bool useTsF;
386 OpHeatFlux(const std::string field_name, FluxData &data,
387 bool ho_geometry = false)
390 dAta(data), hoGeometry(ho_geometry), useTsF(true) {}
391
392 Vec F;
393 OpHeatFlux(const std::string field_name, Vec _F, FluxData &data,
394 bool ho_geometry = false)
397 dAta(data), hoGeometry(ho_geometry), useTsF(false), F(_F) {}
398
399 VectorDouble Nf;
400
401 /** \brief calculate heat flux
402 *
403 * F = int_S N^T * flux dS
404 *
405 */
406 MoFEMErrorCode doWork(int side, EntityType type,
407 EntitiesFieldData::EntData &data);
408 };
409
410 /**
411 * operator to calculate radiation therms on body surface and assemble to lhs
412 * of equations for the jocabian Matrix of Picard Linearization \ingroup
413 * mofem_thermal_elem
414 */
418 &commonData; // get the temperature or temperature Rate from CommonData
421 bool useTsB;
422
423 OpRadiationLhs(const std::string field_name, RadiationData &data,
424 CommonData &common_data, bool ho_geometry = false)
427 commonData(common_data), dAta(data), hoGeometry(ho_geometry),
428 useTsB(true) {}
429
430 Mat A;
431 OpRadiationLhs(const std::string field_name, Mat _A, RadiationData &data,
432 CommonData &common_data, bool ho_geometry = false)
435 commonData(common_data), dAta(data), hoGeometry(ho_geometry),
436 useTsB(false), A(_A) {}
437
438 MatrixDouble N, transN;
439
440 /** \brief calculate thermal radiation term in the lhs of equations(Tangent
441 * Matrix) for transient Thermal Problem
442 *
443 * K = intS 4* N^T* sIgma* eMissivity* N* T^3 dS (Reference _ see Finite
444 * Element Simulation of Heat Transfer by jean-Michel Bergheau)
445 */
446 MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
447 EntityType col_type,
448 EntitiesFieldData::EntData &row_data,
449 EntitiesFieldData::EntData &col_data);
450 };
451
452 /** \brief operator to calculate radiation therms on body surface and assemble
453 * to rhs of transient equations(Residual Vector) \ingroup mofem_thermal_elem
454 */
457
459 &commonData; // get the temperature or temperature Rate from CommonData
462 bool useTsF;
463 OpRadiationRhs(const std::string field_name, RadiationData &data,
464 CommonData &common_data, bool ho_geometry = false)
467 commonData(common_data), dAta(data), hoGeometry(ho_geometry),
468 useTsF(true) {}
469
470 Vec F;
471 OpRadiationRhs(const std::string field_name, Vec _F, RadiationData &data,
472 CommonData &common_data, bool ho_geometry = false)
475 commonData(common_data), dAta(data), hoGeometry(ho_geometry),
476 useTsF(false), F(_F) {}
477
478 VectorDouble Nf;
479
480 /** \brief calculate Transient Radiation condition on the right hand side
481 *residual
482 *
483 * R=int_S N^T * sIgma * eMissivity * (Ta^4 -Ts^4) dS
484 **/
485 MoFEMErrorCode doWork(int side, EntityType type,
486 EntitiesFieldData::EntData &data);
487 };
488
489 /** \brief operator to calculate convection therms on body surface and
490 * assemble to rhs of equations \ingroup mofem_thermal_elem
491 */
494
496 &commonData; // get the temperature or temperature Rate from CommonData
499 bool useTsF;
500 OpConvectionRhs(const std::string field_name, ConvectionData &data,
501 CommonData &common_data, bool ho_geometry = false)
504 commonData(common_data), dAta(data), hoGeometry(ho_geometry),
505 useTsF(true) {}
506
507 Vec F;
508 OpConvectionRhs(const std::string field_name, Vec _F, ConvectionData &data,
509 CommonData &common_data, bool ho_geometry = false)
512 commonData(common_data), dAta(data), hoGeometry(ho_geometry),
513 useTsF(false), F(_F) {}
514
515 VectorDouble Nf;
516
517 /** brief calculate Convection condition on the right hand side
518 * R=int_S N^T*alpha*N_f dS **/
519
520 MoFEMErrorCode doWork(int side, EntityType type,
521 EntitiesFieldData::EntData &data);
522 };
523
524 /// \biref operator to calculate convection therms on body surface and
525 /// assemble to lhs of equations
528
531 bool useTsB;
532
533 OpConvectionLhs(const std::string field_name, ConvectionData &data,
534 bool ho_geometry = false)
537 dAta(data), hoGeometry(ho_geometry), useTsB(true) {}
538
539 Mat A;
540 OpConvectionLhs(const std::string field_name, Mat _A, ConvectionData &data,
541 bool ho_geometry = false)
544 dAta(data), hoGeometry(ho_geometry), useTsB(false), A(_A) {}
545
546 MatrixDouble K, transK;
547 /** \brief calculate thermal convection term in the lhs of equations
548 *
549 * K = intS N^T alpha N dS
550 */
551 MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
552 EntityType col_type,
553 EntitiesFieldData::EntData &row_data,
554 EntitiesFieldData::EntData &col_data);
555 };
556
557 /** \brief this calass is to control time stepping
558 * \ingroup mofem_thermal_elem
559 *
560 * It is used to save data for temperature rate vector to MoFEM field.
561 */
562 struct UpdateAndControl : public FEMethod {
563
565 const std::string tempName;
566 const std::string rateName;
567
568 UpdateAndControl(MoFEM::Interface &m_field, const std::string temp_name,
569 const std::string rate_name)
570 : mField(m_field), tempName(temp_name), rateName(rate_name) {}
571
572 MoFEMErrorCode preProcess();
573 MoFEMErrorCode postProcess();
574 };
575
576 /** \brief TS monitore it records temperature at time steps
577 * \ingroup mofem_thermal_elem
578 */
579 struct TimeSeriesMonitor : public FEMethod {
580
582 const std::string seriesName;
583 const std::string tempName;
584 BitRefLevel mask;
585
586 using Ele = ForcesAndSourcesCore;
587 using VolEle = VolumeElementForcesAndSourcesCore;
588 using VolOp = VolumeElementForcesAndSourcesCore::UserDataOperator;
589 using SetPtsData = FieldEvaluatorInterface::SetPtsData;
590
591 boost::shared_ptr<SetPtsData> dataFieldEval;
592 boost::shared_ptr<VectorDouble> tempPtr;
593
594 std::vector<std::array<double, 3>> evalPoints;
595
596 TimeSeriesMonitor(MoFEM::Interface &m_field, const std::string series_name,
597 const std::string temp_name,
598 std::vector<std::array<double, 3>> eval_points = {})
599 : mField(m_field), seriesName(series_name), tempName(temp_name),
600 evalPoints(eval_points),
601 dataFieldEval(m_field.getInterface<FieldEvaluatorInterface>()
602 ->getData<VolEle>()) {
603 mask.set();
604
605 if (!evalPoints.empty()) {
606 ierr = m_field.getInterface<FieldEvaluatorInterface>()->buildTree3D(
607 dataFieldEval, "THERMAL_FE");
608 CHKERRABORT(PETSC_COMM_WORLD, ierr);
609
610 auto no_rule = [](int, int, int) { return -1; };
611
612 tempPtr = boost::make_shared<VectorDouble>();
613
614 boost::shared_ptr<Ele> vol_ele(dataFieldEval->feMethodPtr.lock());
615 vol_ele->getRuleHook = no_rule;
616
617 vol_ele->getOpPtrVector().push_back(
618 new OpCalculateScalarFieldValues("TEMP", tempPtr));
619 }
620 }
621
623 };
624
625 /** \brief add thermal element on tets
626 * \ingroup mofem_thermal_elem
627 *
628 * It get data from block set and define element in moab
629 *w
630 * \param field name
631 * \param name of mesh nodal positions (if not defined nodal coordinates are
632 *used)
633 */
635 const std::string field_name,
636 const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS");
637
638 /** \brief add heat flux element
639 * \ingroup mofem_thermal_elem
640 *
641 * It get data from heat flux set and define element in moab. Alternatively
642 * uses block set with name including substring HEAT_FLUX.
643 *
644 * \param field name
645 * \param name of mesh nodal positions (if not defined nodal coordinates are
646 * used)
647 */
649 const std::string field_name,
650 const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS");
651
652 /** \brief add convection element
653 * \ingroup mofem_thermal_elem
654 *
655 * It get data from convection set and define element in moab. Alternatively
656 * uses block set with name including substring CONVECTION.
657 *
658 * \param field name
659 * \param name of mesh nodal positions (if not defined nodal coordinates are
660 * used)
661 */
663 const std::string field_name,
664 const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS");
665
666 /** \brief add Non-linear Radiation element
667 * \ingroup mofem_thermal_elem
668 *
669 * It get data from Radiation set and define element in moab. Alternatively
670 * uses block set with name including substring RADIATION.
671 *
672 * \param field name
673 * \param name of mesh nodal positions (if not defined nodal coordinates are
674 * used)
675 */
677 const std::string field_name,
678 const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS");
679
680 /** \brief this function is used in case of stationary problem to set elements
681 * for rhs \ingroup mofem_thermal_elem
682 */
684
685 /** \brief this function is used in case of stationary heat conductivity
686 * problem for lhs \ingroup mofem_thermal_elem
687 */
689
690 /** \brief this function is used in case of stationary problem for heat flux
691 * terms \ingroup mofem_thermal_elem
692 */
694 string field_name, Vec &F,
695 const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS");
696
697 /* \brief linear Steady convection terms in lhs
698 */
700 string field_name, Vec &F,
701 const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS");
702
703 /* \brief linear Steady convection terms in rhs
704 */
706 string field_name, Mat A,
707 const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS");
708
709 /** \brief set up operators for unsteady heat flux; convection; radiation
710 * problem \ingroup mofem_thermal_elem
711 */
713 string field_name, string rate_name,
714 const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS");
715
716 /** \brief set up operators for unsteady heat flux; convection; radiation
717 * problem \ingroup mofem_thermal_elem
718 */
720 TsCtx &ts_ctx, string field_name, string rate_name,
721 const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS");
722};
723
724#endif //__THERMAL_ELEMENT_HPP
725
726/**
727 * \defgroup mofem_thermal_elem Thermal element
728 * \ingroup user_modules
729 **/
ForcesAndSourcesCore::UserDataOperator UserDataOperator
static PetscErrorCode ierr
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
@ MOFEM_STD_EXCEPTION_THROW
Definition: definitions.h:39
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
constexpr int order
@ F
MoFEMErrorCode addThermalElements(const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
add thermal element on tets
MoFEMErrorCode setThermalFluxFiniteElementRhsOperators(string field_name, Vec &F, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
this function is used in case of stationary problem for heat flux terms
MoFEMErrorCode setThermalFiniteElementRhsOperators(string field_name, Vec &F)
this function is used in case of stationary problem to set elements for rhs
MoFEMErrorCode setThermalFiniteElementLhsOperators(string field_name, Mat A)
this function is used in case of stationary heat conductivity problem for lhs
MoFEMErrorCode addThermalFluxElement(const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
add heat flux element
MoFEMErrorCode addThermalConvectionElement(const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
add convection element
MoFEMErrorCode addThermalRadiationElement(const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
add Non-linear Radiation element
MoFEMErrorCode setTimeSteppingProblem(string field_name, string rate_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
set up operators for unsteady heat flux; convection; radiation problem
MoFEM::TsCtx * ts_ctx
Definition: level_set.cpp:1932
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
constexpr AssemblyType A
constexpr auto field_name
#define _F(n)
Definition: quad.c:25
Deprecated interface functions.
@ OPROW
operator doWork function is executed on FE rows
@ OPROWCOL
operator doWork is executed on FE rows &columns
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
VolumeElementForcesAndSourcesCore(Interface &m_field, const EntityType type=MBTET)
data for calculation heat conductivity and heat capacity elements
double initTemp
initial temperature
Range tEts
contains elements in block set
common data used by volume elements
VectorDouble temperatureRateAtGaussPts
ublas::matrix_row< MatrixDouble > getGradAtGaussPts(const int gg)
data for calculation heat flux
Range tRis
surface triangles where hate flux is applied
HeatFluxCubitBcData dAta
define surface element
MyTriFE(MoFEM::Interface &m_field)
definition of volume element
int getRule(int order)
it is used to calculate nb. of Gauss integration points
MyVolumeFE(MoFEM::Interface &m_field)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
calculate thermal convection term in the lhs of equations
OpConvectionLhs(const std::string field_name, ConvectionData &data, bool ho_geometry=false)
OpConvectionLhs(const std::string field_name, Mat _A, ConvectionData &data, bool ho_geometry=false)
operator to calculate convection therms on body surface and assemble to rhs of equations
OpConvectionRhs(const std::string field_name, ConvectionData &data, CommonData &common_data, bool ho_geometry=false)
OpConvectionRhs(const std::string field_name, Vec _F, ConvectionData &data, CommonData &common_data, bool ho_geometry=false)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
operator to calculate temperature and rate of temperature at Gauss points
OpGetFieldAtGaussPts(const std::string field_name, VectorDouble &field_at_gauss_pts)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
operator calculating temperature and rate of temperature
operator to calculate temperature gradient at Gauss points
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
operator calculating temperature gradients
OpGetGradAtGaussPts(const std::string field_name, CommonData &common_data)
operator to calculate temperature rate at Gauss pts
OpGetTetRateAtGaussPts(const std::string field_name, CommonData &common_data)
operator to calculate temperature at Gauss pts
OpGetTetTemperatureAtGaussPts(const std::string field_name, CommonData &common_data)
operator to calculate temperature at Gauss pts
OpGetTriTemperatureAtGaussPts(const std::string field_name, CommonData &common_data)
operator to calculate left hand side of heat capacity terms
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
calculate heat capacity matrix
OpHeatCapacityLhs(const std::string field_name, BlockData &data, CommonData &common_data)
operator to calculate right hand side of heat capacity terms
OpHeatCapacityRhs(const std::string field_name, BlockData &data, CommonData &common_data)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate thermal conductivity matrix
operator for calculate heat flux and assemble to right hand side
OpHeatFlux(const std::string field_name, FluxData &data, bool ho_geometry=false)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate heat flux
OpHeatFlux(const std::string field_name, Vec _F, FluxData &data, bool ho_geometry=false)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
calculate thermal radiation term in the lhs of equations(Tangent Matrix) for transient Thermal Proble...
OpRadiationLhs(const std::string field_name, Mat _A, RadiationData &data, CommonData &common_data, bool ho_geometry=false)
OpRadiationLhs(const std::string field_name, RadiationData &data, CommonData &common_data, bool ho_geometry=false)
operator to calculate radiation therms on body surface and assemble to rhs of transient equations(Res...
OpRadiationRhs(const std::string field_name, Vec _F, RadiationData &data, CommonData &common_data, bool ho_geometry=false)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate Transient Radiation condition on the right hand side residual
OpRadiationRhs(const std::string field_name, RadiationData &data, CommonData &common_data, bool ho_geometry=false)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
calculate thermal conductivity matrix
OpThermalLhs(const std::string field_name, Mat _A, BlockData &data, CommonData &common_data)
OpThermalLhs(const std::string field_name, BlockData &data, CommonData &common_data)
OpThermalRhs(const std::string field_name, Vec _F, BlockData &data, CommonData &common_data)
OpThermalRhs(const std::string field_name, BlockData &data, CommonData &common_data)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate thermal conductivity matrix
TS monitore it records temperature at time steps.
boost::shared_ptr< SetPtsData > dataFieldEval
TimeSeriesMonitor(MoFEM::Interface &m_field, const std::string series_name, const std::string temp_name, std::vector< std::array< double, 3 > > eval_points={})
std::vector< std::array< double, 3 > > evalPoints
VolumeElementForcesAndSourcesCore VolEle
FieldEvaluatorInterface::SetPtsData SetPtsData
VolumeElementForcesAndSourcesCore::UserDataOperator VolOp
boost::shared_ptr< VectorDouble > tempPtr
this calass is to control time stepping
UpdateAndControl(MoFEM::Interface &m_field, const std::string temp_name, const std::string rate_name)
structure grouping operators and data used for thermal problems
MyTriFE & getLoopFeConvectionLhs()
std::map< int, FluxData > setOfFluxes
maps side set id with appropriate FluxData
ThermalElement(MoFEM::Interface &m_field)
MyTriFE feRadiationLhs
MyTriFE feConvectionLhs
MyVolumeFE feRhs
cauclate right hand side for tetrahedral elements
MyTriFE & getLoopFeFlux()
MyVolumeFE & getLoopFeLhs()
get lhs volume element
MyTriFE feConvectionRhs
MyTriFE & getLoopFeConvectionRhs()
MoFEM::Interface & mField
MyVolumeFE & getLoopFeRhs()
get rhs volume element
MyTriFE & getLoopFeRadiationRhs()
CommonData commonData
MoFEMErrorCode setThermalConvectionFiniteElementLhsOperators(string field_name, Mat A, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
MyVolumeFE feLhs
MyTriFE feRadiationRhs
std::map< int, RadiationData > setOfRadiation
std::map< int, ConvectionData > setOfConvection
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
MyTriFE & getLoopFeRadiationLhs()
MoFEMErrorCode setThermalConvectionFiniteElementRhsOperators(string field_name, Vec &F, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")