1 #ifndef VERTEXCFD_BOUNDARYSTATE_INCOMPRESSIBLELSVOFNOSLIP_IMPL_HPP
2 #define VERTEXCFD_BOUNDARYSTATE_INCOMPRESSIBLELSVOFNOSLIP_IMPL_HPP
4 #include "utils/VertexCFD_Utils_PhaseLayout.hpp"
5 #include "utils/VertexCFD_Utils_VectorField.hpp"
7 #include <Panzer_HierarchicParallelism.hpp>
8 #include <Panzer_Workset_Utilities.hpp>
9 #include <Teuchos_StandardParameterEntryValidators.hpp>
13 namespace BoundaryCondition
16 template<
class EvalType,
class Traits,
int NumSpaceDim>
17 IncompressibleLSVOFNoSlip<EvalType, Traits, NumSpaceDim>::IncompressibleLSVOFNoSlip(
18 const panzer::IntegrationRule& ir,
19 const int& num_lsvof_dofs,
20 const std::string& continuity_model_name,
21 const bool& build_mom_equ)
22 : _phase_layout(Utils::buildPhaseLayout(ir.dl_scalar, num_lsvof_dofs))
23 , _boundary_lagrange_pressure(
"BOUNDARY_lagrange_pressure", ir.dl_scalar)
24 , _boundary_grad_lagrange_pressure(
"BOUNDARY_GRAD_lagrange_pressure",
26 , _boundary_alphas(
"BOUNDARY_volume_fractions", _phase_layout)
27 , _lagrange_pressure(
"lagrange_pressure", ir.dl_scalar)
28 , _grad_lagrange_pressure(
"GRAD_lagrange_pressure", ir.dl_vector)
29 , _normals(
"Side Normal", ir.dl_vector)
30 , _alphas(
"volume_fractions", _phase_layout)
31 , _is_edac(continuity_model_name ==
"EDAC" ? true : false)
32 , _build_mom_equ(build_mom_equ)
37 this->addEvaluatedField(_boundary_lagrange_pressure);
39 this->addEvaluatedField(_boundary_grad_lagrange_pressure);
41 Utils::addEvaluatedVectorField(
42 *
this, ir.dl_scalar, _boundary_velocity,
"BOUNDARY_velocity_");
43 Utils::addEvaluatedVectorField(*
this,
45 _boundary_grad_velocity,
46 "BOUNDARY_GRAD_velocity_");
49 this->addEvaluatedField(_boundary_alphas);
54 this->addDependentField(_lagrange_pressure);
56 this->addDependentField(_grad_lagrange_pressure);
57 this->addDependentField(_normals);
59 Utils::addDependentVectorField(
60 *
this, ir.dl_vector, _grad_velocity,
"GRAD_velocity_");
63 this->addDependentField(_alphas);
65 this->setName(
"Boundary State Incompressible LSVOF No-Slip");
69 template<
class EvalType,
class Traits,
int NumSpaceDim>
70 void IncompressibleLSVOFNoSlip<EvalType, Traits, NumSpaceDim>::evaluateFields(
71 typename Traits::EvalData workset)
73 auto policy = panzer::HP::inst().teamPolicy<scalar_type, PHX::Device>(
75 Kokkos::parallel_for(this->getName(), policy, *
this);
79 template<
class EvalType,
class Traits,
int NumSpaceDim>
80 KOKKOS_INLINE_FUNCTION
void
81 IncompressibleLSVOFNoSlip<EvalType, Traits, NumSpaceDim>::operator()(
82 const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team)
const
84 const int cell = team.league_rank();
85 const int num_point = _boundary_lagrange_pressure.extent(1);
86 const int num_grad_dim = _boundary_grad_velocity[0].extent(2);
89 Kokkos::TeamThreadRange(team, 0, num_point), [&](
const int point) {
93 for (
int vel_dim = 0; vel_dim < num_space_dim; ++vel_dim)
95 _boundary_velocity[vel_dim](cell, point) = 0.0;
98 _boundary_lagrange_pressure(cell, point)
99 = _lagrange_pressure(cell, point);
102 for (
int d = 0; d < num_grad_dim; ++d)
107 _boundary_grad_lagrange_pressure(cell, point, d)
108 = _grad_lagrange_pressure(cell, point, d);
111 for (
int vel_dim = 0; vel_dim < num_space_dim; ++vel_dim)
113 _boundary_grad_velocity[vel_dim](cell, point, d)
114 = _grad_velocity[vel_dim](cell, point, d);
120 _boundary_grad_lagrange_pressure(cell, point, d)
121 -= _grad_lagrange_pressure(cell, point, vel_dim)
122 * _normals(cell, point, vel_dim)
123 * _normals(cell, point, d);
130 for (
size_t phase = 0; phase < _alphas.extent(2); ++phase)
132 _boundary_alphas(cell, point, phase)
133 = _alphas(cell, point, phase);
143 #endif // VERTEXCFD_BOUNDARYSTATE_INCOMPRESSIBLELSVOFNOSLIP_IMPL_HPP