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

[OpWettingAngleLhs] More...

#include "tutorials/vec-5_free_surface/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

[OpWettingAngleLhs]

[OpRhsU]

Rhs for U (momentum residual)

Parameters
field_nameName of the field associated with the operator
dot_u_ptrPointer to the velocity time derivative matrix (∂U/∂t)
u_ptrPointer to the velocity matrix (U)
grad_u_ptrPointer to the velocity gradient matrix (∇U)
h_ptrPointer to the free surface height vector (h)
grad_h_ptrPointer to the free surface height gradient matrix (∇h)
g_ptrPointer to the chemical potential vector (g)
p_ptrPointer to the pressure vector (p)
Returns
MoFEMErrorCode

This operator implements the volume terms of the momentum equation (not Jacobian) (Lovric 3.1a)

R_u = ∫_Ω w·(ρ(h)(∂u/∂t + u·∇u + a_0) - κg∇h) - (∇·w)p + (∇w):(2μ(h)D(u))dΩ

Code ↔ PDE term mapping (paper notation : code variable)

Examples
mofem/tutorials/vec-5_free_surface/free_surface.cpp.

Definition at line 475 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 477 of file FreeSurfaceOps.hpp.

485 : AssemblyDomainEleOp(field_name, field_name, AssemblyDomainEleOp::OPROW),
486 dotUPtr(dot_u_ptr), uPtr(u_ptr), gradUPtr(grad_u_ptr), hPtr(h_ptr),
487 gradHPtr(grad_h_ptr), gPtr(g_ptr), pPtr(p_ptr) {}
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
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp

Member Function Documentation

◆ iNtegrate()

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

Definition at line 489 of file FreeSurfaceOps.hpp.

489 {
491
492 const double vol = getMeasure();
493 auto t_dot_u = getFTensor1FromMat<U_FIELD_DIM>(*dotUPtr);
494 auto t_u = getFTensor1FromMat<U_FIELD_DIM>(*uPtr);
495 auto t_p = getFTensor0FromVec(*pPtr);
496 auto t_grad_u = getFTensor2FromMat<U_FIELD_DIM, SPACE_DIM>(*gradUPtr);
497 auto t_h = getFTensor0FromVec(*hPtr);
498 auto t_grad_h = getFTensor1FromMat<SPACE_DIM>(*gradHPtr);
499 auto t_g = getFTensor0FromVec(*gPtr);
500 auto t_coords = getFTensor1CoordsAtGaussPts();
501
502 auto t_base = data.getFTensor0N();
503 auto t_diff_base = data.getFTensor1DiffN<SPACE_DIM>();
504
505 auto t_w = getFTensor0IntegrationWeight();
506
515
516 t_buoyancy(i) = 0;
517 t_gravity(i) = 0;
518
519 for (int gg = 0; gg != nbIntegrationPts; gg++) {
520
521 const double r = t_coords(0);
522 const double alpha = t_w * vol * cylindrical(r);
523
524 const double rho = phase_function(t_h, rho_diff, rho_ave);
525 const double mu = phase_function(t_h, mu_diff, mu_ave);
526
527 auto t_D = get_D(2 * mu);
528
529 t_inertia_force(i) = (rho * alpha) * (t_dot_u(i)); // ρ(h)∂U/∂t
530 // t_buoyancy(SPACE_DIM - 1) = -(alpha * rho * a0) * t_h;
531 t_gravity(SPACE_DIM - 1) = (alpha * rho * a0); // ρ(h)a_0 (a_0 is gravity)
532 t_phase_force(i) = -alpha * kappa * t_g * t_grad_h(i); // -κg∇h
533 t_convection(i) = (rho * alpha) * (t_u(j) * t_grad_u(i, j)); // ρ(h)(U·∇)U
534
535 t_stress(i, j) =
536 alpha * (t_D(i, j, k, l) * t_grad_u(k, l) + t_kd(i, j) * t_p); // ∇·(2μ(h)D(U))
537
538 auto t_nf = getFTensor1FromArray<U_FIELD_DIM, U_FIELD_DIM>(locF);
539
540 t_forces(i) = t_inertia_force(i) + t_buoyancy(i) + t_gravity(i) +
541 t_convection(i) + t_phase_force(i);
542
543 int bb = 0;
544 for (; bb != nbRows / U_FIELD_DIM; ++bb) {
545
546 // Assemble total force contributions into local residual
547 t_nf(i) += t_base * t_forces(i);
548 t_nf(i) += t_diff_base(j) * t_stress(i, j); // ∇w : ∇·(2μ(h)D(U)) - ∇p
549
550 if (coord_type == CYLINDRICAL) {
551 t_nf(0) += (t_base * (alpha / t_coords(0))) * (2 * mu * t_u(0) + t_p);
552 }
553
554 ++t_base;
555 ++t_diff_base;
556 ++t_nf;
557 }
558
559 for (; bb < nbRowBaseFunctions; ++bb) {
560 ++t_diff_base;
561 ++t_base;
562 }
563
564 ++t_dot_u;
565 ++t_u;
566 ++t_grad_u;
567 ++t_h;
568 ++t_grad_h;
569 ++t_g;
570 ++t_p;
571
572 ++t_w;
573 ++t_coords;
574 }
575
577 }
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 ...
@ CYLINDRICAL
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
auto cylindrical
[cylindrical]
double kappa
double mu_diff
constexpr int U_FIELD_DIM
double rho_diff
constexpr auto t_kd
double rho_ave
double mu_ave
auto phase_function
Phase-dependent material property interpolation.
auto get_D
Create deviatoric stress tensor.
constexpr double a0
FTensor::Index< 'i', SPACE_DIM > i
constexpr CoordinateTypes coord_type
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
int r
Definition sdf.py:205
double rho
Definition plastic.cpp:144

Member Data Documentation

◆ dotUPtr

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

Definition at line 580 of file FreeSurfaceOps.hpp.

◆ gPtr

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

Definition at line 585 of file FreeSurfaceOps.hpp.

◆ gradHPtr

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

Definition at line 584 of file FreeSurfaceOps.hpp.

◆ gradUPtr

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

Definition at line 582 of file FreeSurfaceOps.hpp.

◆ hPtr

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

Definition at line 583 of file FreeSurfaceOps.hpp.

◆ pPtr

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

Definition at line 586 of file FreeSurfaceOps.hpp.

◆ uPtr

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

Definition at line 581 of file FreeSurfaceOps.hpp.


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