https://mooseframework.inl.gov
FVAdvectedUpwind.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 
9 #include "FVAdvectedUpwind.h"
10 
12 
15 {
17  params.addClassDescription(
18  "Upwind interpolation for advected quantities using the face mass flux sign.");
19  return params;
20 }
21 
23 {
24 }
25 
28  Real /*elem_value*/,
29  Real /*neighbor_value*/,
30  const VectorValue<Real> * /*elem_grad*/,
31  const VectorValue<Real> * /*neighbor_grad*/,
32  Real mass_flux) const
33 {
35  // Branchless upwind selection to keep interpolation SIMD/GPU friendly
36  const Real neighbor_weight = mass_flux < 0.0;
37  result.weights_matrix = std::make_pair(1.0 - neighbor_weight, neighbor_weight);
38  return result;
39 }
40 
41 Real
43  Real elem_value,
44  Real neighbor_value,
45  const VectorValue<Real> * /*elem_grad*/,
46  const VectorValue<Real> * /*neighbor_grad*/,
47  Real mass_flux) const
48 {
49  return mass_flux < 0.0 ? neighbor_value : elem_value;
50 }
AdvectedSystemContribution advectedInterpolate(const FaceInfo &face, Real, Real, const VectorValue< Real > *, const VectorValue< Real > *, Real mass_flux) const override
Compute the matrix weights for the advected face value.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Registered base class for linear FV interpolation objects.
FVAdvectedUpwind(const InputParameters &params)
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:37
Upwind interpolation for advected quantities based on the sign of the face mass flux.
Real advectedInterpolateValue(const FaceInfo &face, Real elem_value, Real neighbor_value, const VectorValue< Real > *, const VectorValue< Real > *, Real mass_flux) const override
Compute the advected face value.
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Matrix/RHS contribution for an advected face interpolation.
registerMooseObject("MooseApp", FVAdvectedUpwind)
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
static InputParameters validParams()