1 #ifndef VERTEXCFD_CLOSURE_INCOMPRESSIBLELSVOFSCALARTIMEDERIVATIVE_IMPL_HPP
2 #define VERTEXCFD_CLOSURE_INCOMPRESSIBLELSVOFSCALARTIMEDERIVATIVE_IMPL_HPP
4 #include "utils/VertexCFD_Utils_VectorField.hpp"
6 #include <Panzer_HierarchicParallelism.hpp>
12 namespace ClosureModel
15 template<
class EvalType,
class Traits>
16 IncompressibleLSVOFScalarTimeDerivative<EvalType, Traits>::
17 IncompressibleLSVOFScalarTimeDerivative(
const panzer::IntegrationRule& ir,
18 const std::string& dof_name,
19 const std::string& eqn_name,
20 const bool& mass_weighted)
21 : _dqdt_dof(
"DQDT_" + eqn_name, ir.dl_scalar)
22 , _dof(dof_name, ir.dl_scalar)
23 , _rho(
"density", ir.dl_scalar)
24 , _dxdt_dof(
"DXDT_" + dof_name, ir.dl_scalar)
25 , _dxdt_rho(
"DXDT_density", ir.dl_scalar)
26 , _mass_weighted(mass_weighted)
29 this->addEvaluatedField(_dqdt_dof);
32 this->addDependentField(_dxdt_dof);
36 this->addDependentField(_dof);
37 this->addDependentField(_rho);
38 this->addDependentField(_dxdt_rho);
41 this->setName(
"Incompressible LSVOF " + dof_name +
" Time Derivative");
45 template<
class EvalType,
class Traits>
46 void IncompressibleLSVOFScalarTimeDerivative<EvalType, Traits>::evaluateFields(
47 typename Traits::EvalData workset)
49 auto policy = panzer::HP::inst().teamPolicy<scalar_type, PHX::Device>(
51 Kokkos::parallel_for(this->getName(), policy, *
this);
55 template<
class EvalType,
class Traits>
56 KOKKOS_INLINE_FUNCTION
void
57 IncompressibleLSVOFScalarTimeDerivative<EvalType, Traits>::operator()(
58 const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team)
const
60 const int cell = team.league_rank();
61 const int num_point = _dqdt_dof.extent(1);
64 Kokkos::TeamThreadRange(team, 0, num_point), [&](
const int point) {
67 _dqdt_dof(cell, point)
68 = _rho(cell, point) * _dxdt_dof(cell, point)
69 + _dxdt_rho(cell, point) * _dof(cell, point);
73 _dqdt_dof(cell, point) = _dxdt_dof(cell, point);