https://mooseframework.inl.gov
NLBoundaryConvectiveHeatFluxIntegrator.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #ifdef MOOSE_MFEM_ENABLED
11 
13 
14 namespace Moose::MFEM
15 {
17  mfem::Coefficient & k,
18  mfem::Coefficient & dk_du,
19  mfem::Coefficient & gf_offset,
20  mfem::Coefficient & gf)
21  : _shifted_gf_coef(gf, gf_offset, 1.0, -1.0), // u-u_inf
22  _k_uinf_coef(k, gf_offset), // k(u)*u_inf
23  _net_flux_du_coef(dk_du, _shifted_gf_coef), // dk/du*(u-u_inf)
24  _inwards_flux(_k_uinf_coef),
25  _outwards_flux(k),
26  _jacobian_k_component(k),
27  _jacobian_dk_du_component(_net_flux_du_coef)
28 {
31 }
32 
33 void
35  mfem::ElementTransformation & Tr,
36  const mfem::Vector & elfun,
37  mfem::Vector & elvect)
38 {
39  mfem::Vector ext_flux_elvect; // vector to store flux coming from outside of domain
40  _outwards_flux.AssembleElementVector(el, Tr, elfun, elvect); // (k(u)*u, v)
41  _inwards_flux.AssembleRHSElementVect(el, Tr, ext_flux_elvect); // (k(u)*u_inf, v)
42  elvect -= ext_flux_elvect; // (k(u)*(u-u_inf),v)
43 }
44 
45 void
47  mfem::ElementTransformation & Tr,
48  const mfem::Vector & elfun,
49  mfem::DenseMatrix & elmat)
50 {
51  // (k + dk_du (u-u_inf)) phi, v);
52  _jacobian_action.AssembleElementGrad(el, Tr, elfun, elmat); //
53 }
54 }
55 
56 #endif
virtual void AssembleElementVector(const mfem::FiniteElement &el, mfem::ElementTransformation &Tr, const mfem::Vector &elfun, mfem::Vector &elvect) override
NLBoundaryConvectiveHeatFluxIntegrator(mfem::Coefficient &k, mfem::Coefficient &dk_du, mfem::Coefficient &gf_offset, mfem::Coefficient &gf)
virtual void AssembleElementGrad(const mfem::FiniteElement &el, mfem::ElementTransformation &Tr, const mfem::Vector &elfun, mfem::DenseMatrix &elmat) override
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).