v0.13.1
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
FreeSurfaceOps::OpRhsU Struct Reference

Rhs for U. More...

#include <users_modules/tutorials/vec-5/src/FreeSurfaceOps.hpp>

Inheritance diagram for FreeSurfaceOps::OpRhsU:
[legend]
Collaboration diagram for FreeSurfaceOps::OpRhsU:
[legend]

Public Member Functions

 OpRhsU (const std::string field_name, boost::shared_ptr< MatrixDouble > dot_u_ptr, boost::shared_ptr< MatrixDouble > u_ptr, boost::shared_ptr< MatrixDouble > grad_u_ptr, boost::shared_ptr< VectorDouble > h_ptr, boost::shared_ptr< MatrixDouble > grad_h_ptr, boost::shared_ptr< VectorDouble > g_ptr, boost::shared_ptr< VectorDouble > p_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Private Attributes

boost::shared_ptr< MatrixDouble > dotUPtr
 
boost::shared_ptr< MatrixDouble > uPtr
 
boost::shared_ptr< MatrixDouble > gradUPtr
 
boost::shared_ptr< VectorDouble > hPtr
 
boost::shared_ptr< MatrixDouble > gradHPtr
 
boost::shared_ptr< VectorDouble > gPtr
 
boost::shared_ptr< VectorDouble > pPtr
 

Detailed Description

Rhs for U.

Examples
free_surface.cpp.

Definition at line 193 of file FreeSurfaceOps.hpp.

Constructor & Destructor Documentation

◆ OpRhsU()

FreeSurfaceOps::OpRhsU::OpRhsU ( const std::string  field_name,
boost::shared_ptr< MatrixDouble >  dot_u_ptr,
boost::shared_ptr< MatrixDouble >  u_ptr,
boost::shared_ptr< MatrixDouble >  grad_u_ptr,
boost::shared_ptr< VectorDouble >  h_ptr,
boost::shared_ptr< MatrixDouble >  grad_h_ptr,
boost::shared_ptr< VectorDouble >  g_ptr,
boost::shared_ptr< VectorDouble >  p_ptr 
)
inline

Definition at line 195 of file FreeSurfaceOps.hpp.

203 : AssemblyDomainEleOp(field_name, field_name, AssemblyDomainEleOp::OPROW),
204 dotUPtr(dot_u_ptr), uPtr(u_ptr), gradUPtr(grad_u_ptr), hPtr(h_ptr),
205 gradHPtr(grad_h_ptr), gPtr(g_ptr), pPtr(p_ptr) {}
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp
Definition: plastic.cpp:46
constexpr auto field_name
boost::shared_ptr< MatrixDouble > gradUPtr
boost::shared_ptr< VectorDouble > pPtr
boost::shared_ptr< VectorDouble > gPtr
boost::shared_ptr< VectorDouble > hPtr
boost::shared_ptr< MatrixDouble > dotUPtr
boost::shared_ptr< MatrixDouble > uPtr
boost::shared_ptr< MatrixDouble > gradHPtr

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode FreeSurfaceOps::OpRhsU::iNtegrate ( EntitiesFieldData::EntData &  data)
inline

Definition at line 207 of file FreeSurfaceOps.hpp.

207 {
209
210 const double vol = getMeasure();
211 auto t_dot_u = getFTensor1FromMat<U_FIELD_DIM>(*dotUPtr);
212 auto t_u = getFTensor1FromMat<U_FIELD_DIM>(*uPtr);
213 auto t_p = getFTensor0FromVec(*pPtr);
214 auto t_grad_u = getFTensor2FromMat<U_FIELD_DIM, SPACE_DIM>(*gradUPtr);
215 auto t_h = getFTensor0FromVec(*hPtr);
216 auto t_grad_h = getFTensor1FromMat<SPACE_DIM>(*gradHPtr);
217 auto t_g = getFTensor0FromVec(*gPtr);
218 auto t_coords = getFTensor1CoordsAtGaussPts();
219
220 auto t_base = data.getFTensor0N();
221 auto t_diff_base = data.getFTensor1DiffN<SPACE_DIM>();
222
223 auto t_w = getFTensor0IntegrationWeight();
224
232
233 t_buoyancy(i) = 0;
234
235 for (int gg = 0; gg != nbIntegrationPts; gg++) {
236
237 const double r = t_coords(0);
238 const double alpha = t_w * vol * cylindrical(r);
239
240 const double rho = phase_function(t_h, rho_diff, rho_ave);
241 const double mu = phase_function(t_h, mu_diff, mu_ave);
242
243 auto t_D = get_D(2 * mu);
244
245 t_inertia_force(i) = (rho * alpha) * (t_dot_u(i));
246 t_buoyancy(SPACE_DIM - 1) = -(alpha * rho * a0) * t_h;
247 t_phase_force(i) = -alpha * kappa * t_g * t_grad_h(i);
248 t_convection(i) = (rho * alpha) * (t_u(j) * t_grad_u(i, j));
249
250 t_stress(i, j) =
251 alpha * (t_D(i, j, k, l) * t_grad_u(k, l) + t_kd(i, j) * t_p);
252
253 auto t_nf = getFTensor1FromArray<U_FIELD_DIM, U_FIELD_DIM>(locF);
254
255 t_forces(i) = t_inertia_force(i) + t_buoyancy(i) + t_convection(i) +
256 t_phase_force(i);
257
258 int bb = 0;
259 for (; bb != nbRows / U_FIELD_DIM; ++bb) {
260
261 t_nf(i) += t_base * t_forces(i);
262 t_nf(i) += t_diff_base(j) * t_stress(i, j);
263
264 // When we move to C++17 add if constexpr()
265 if constexpr (coord_type == CYLINDRICAL) {
266 t_nf(0) += (t_base * (alpha / t_coords(0))) * (2 * mu * t_u(0) + t_p);
267 }
268
269 ++t_base;
270 ++t_diff_base;
271 ++t_nf;
272 }
273
274 for (; bb < nbRowBaseFunctions; ++bb) {
275 ++t_diff_base;
276 ++t_base;
277 }
278
279 ++t_dot_u;
280 ++t_u;
281 ++t_grad_u;
282 ++t_h;
283 ++t_grad_h;
284 ++t_g;
285 ++t_p;
286
287 ++t_w;
288 ++t_coords;
289 }
290
292 }
constexpr int SPACE_DIM
Kronecker Delta class symmetric.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ CYLINDRICAL
Definition: definitions.h:117
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
auto cylindrical
constexpr int U_FIELD_DIM
constexpr double rho_ave
constexpr CoordinateTypes coord_type
select coordinate system <CARTESIAN, CYLINDRICAL>;
constexpr double mu_ave
constexpr double mu_diff
constexpr auto t_kd
auto phase_function
constexpr double rho_diff
auto get_D
const double kappa
constexpr double a0
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
const double r
rate factor
double rho
Definition: plastic.cpp:98
constexpr double mu

Member Data Documentation

◆ dotUPtr

boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpRhsU::dotUPtr
private

Definition at line 295 of file FreeSurfaceOps.hpp.

◆ gPtr

boost::shared_ptr<VectorDouble> FreeSurfaceOps::OpRhsU::gPtr
private

Definition at line 300 of file FreeSurfaceOps.hpp.

◆ gradHPtr

boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpRhsU::gradHPtr
private

Definition at line 299 of file FreeSurfaceOps.hpp.

◆ gradUPtr

boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpRhsU::gradUPtr
private

Definition at line 297 of file FreeSurfaceOps.hpp.

◆ hPtr

boost::shared_ptr<VectorDouble> FreeSurfaceOps::OpRhsU::hPtr
private

Definition at line 298 of file FreeSurfaceOps.hpp.

◆ pPtr

boost::shared_ptr<VectorDouble> FreeSurfaceOps::OpRhsU::pPtr
private

Definition at line 301 of file FreeSurfaceOps.hpp.

◆ uPtr

boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpRhsU::uPtr
private

Definition at line 296 of file FreeSurfaceOps.hpp.


The documentation for this struct was generated from the following file: