https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
14namespace Moose::MFEM
15{
17 mfem::Coefficient & k,
18 mfem::Coefficient & dk_du,
19 mfem::Coefficient & duinf_du,
20 mfem::Coefficient & gf_offset,
21 mfem::Coefficient & gf)
22 : _shifted_gf_coef(gf, gf_offset, 1.0, -1.0), // u-u_inf
23 _k_uinf_coef(k, gf_offset), // k(u)*u_inf
24 _net_flux_du_coef(dk_du, _shifted_gf_coef), // dk/du*(u-u_inf)
25 _k_duinf_du_coef(k, duinf_du), // k(u) * du_inf/du
26 _duinf_du_flux_coef(-1.0, _k_duinf_du_coef), // -k(u) * du_inf/du
27 _inwards_flux(_k_uinf_coef),
28 _outwards_flux(k),
29 _jacobian_k_component(k),
30 _jacobian_dk_du_component(_net_flux_du_coef),
31 _jacobian_duinf_du_component(_duinf_du_flux_coef)
32{
36}
37
38void
40 mfem::ElementTransformation & Tr,
41 const mfem::Vector & elfun,
42 mfem::Vector & elvect)
43{
44 mfem::Vector ext_flux_elvect; // vector to store flux coming from outside of domain
45 _outwards_flux.AssembleElementVector(el, Tr, elfun, elvect); // (k(u)*u, v)
46 _inwards_flux.AssembleRHSElementVect(el, Tr, ext_flux_elvect); // (k(u)*u_inf, v)
47 elvect -= ext_flux_elvect; // (k(u)*(u-u_inf),v)
48}
49
50void
52 mfem::ElementTransformation & Tr,
53 const mfem::Vector & elfun,
54 mfem::DenseMatrix & elmat)
55{
56 // (k (1 - du_inf/du) + dk_du (u-u_inf)) phi, v);
57 _jacobian_action.AssembleElementGrad(el, Tr, elfun, elmat);
58}
59}
60
61#endif
NLBoundaryConvectiveHeatFluxIntegrator(mfem::Coefficient &k, mfem::Coefficient &dk_du, mfem::Coefficient &duinf_du, mfem::Coefficient &gf_offset, mfem::Coefficient &gf)
Construct the nonlinear convective heat flux residual and Jacobian action.
virtual void AssembleElementVector(const mfem::FiniteElement &el, mfem::ElementTransformation &Tr, const mfem::Vector &elfun, mfem::Vector &elvect) override
mfem::BoundaryMassIntegrator _outwards_flux
Boundary mass integrator for the outwards flux term.
mfem::BoundaryMassIntegrator _jacobian_k_component
Jacobian contribution from the h(T) term.
mfem::BoundaryMassIntegrator _jacobian_duinf_du_component
Jacobian contribution from the dT_inf/dT term.
mfem::BoundaryMassIntegrator _jacobian_dk_du_component
Jacobian contribution from the dh/dT term.
mfem::BoundaryLFIntegrator _inwards_flux
Boundary load integrator for the inwards flux term.
mfem::SumIntegrator _jacobian_action
Sum of the boundary mass integrators forming the Jacobian action.
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).