https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADBoundaryFlux3EqnGhostBase.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
12
13#include "libmesh/elem.h"
14
17{
19
20 params.addClassDescription("Computes boundary fluxes for the 1-D, variable-area Euler equations "
21 "using a numerical flux user object and a ghost cell solution");
22
23 params.addRequiredParam<UserObjectName>("numerical_flux", "Name of numerical flux user object");
24 params.addRequiredParam<Real>("normal", "Outward normal");
25
26 return params;
27}
28
30 : ADBoundaryFluxBase(parameters),
31 _numerical_flux(getUserObject<ADNumericalFlux3EqnBase>("numerical_flux")),
32 _normal(getParam<Real>("normal"))
33{
34}
35
36void
38 dof_id_type ielem,
39 const std::vector<ADReal> & U1,
40 const RealVectorValue & /*normal*/,
41 std::vector<ADReal> & flux) const
42{
43 const Elem * elem = _subproblem.mesh().elemPtr(ielem);
44 const Elem * side_elem = elem->build_side_ptr(iside).release();
45 const Point side_center_point = side_elem->vertex_average();
46 delete side_elem;
47
48 const std::vector<ADReal> U2 = getGhostCellSolution(U1, side_center_point);
49 flux = _numerical_flux.getFlux(iside, ielem, true, U1, U2, _normal);
50}
const Real & _normal
Outward normal.
virtual void calcFlux(unsigned int iside, dof_id_type ielem, const std::vector< ADReal > &U1, const RealVectorValue &normal, std::vector< ADReal > &flux) const override
Solve the Riemann problem on the boundary face.
ADBoundaryFlux3EqnGhostBase(const InputParameters &parameters)
virtual std::vector< ADReal > getGhostCellSolution(const std::vector< ADReal > &U1, const Point &point) const =0
Gets the solution vector in the ghost cell.
const ADNumericalFlux3EqnBase & _numerical_flux
Numerical flux user object.
A base class for computing/caching fluxes at boundaries.
static InputParameters validParams()
Base class for computing numerical fluxes for FlowModelSinglePhase.
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
virtual Elem * elemPtr(const dof_id_type i)
virtual const std::vector< ADReal > & getFlux(const unsigned int iside, const dof_id_type ielem, bool res_side_is_left, const std::vector< ADReal > &UL_1d, const std::vector< ADReal > &UR_1d, Real nLR_dot_d) const
Gets the 1D flux vector for an element/side combination.
virtual MooseMesh & mesh()=0