https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
18 "Upwind interpolation for advected quantities using the face mass flux sign.");
19 return params;
20}
21
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
41Real
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}
registerMooseObject("MooseApp", FVAdvectedUpwind)
Upwind interpolation for advected quantities based on the sign of the face mass flux.
static InputParameters validParams()
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.
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.
FVAdvectedUpwind(const InputParameters &params)
Registered base class for linear FV interpolation objects.
static InputParameters validParams()
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
Matrix/RHS contribution for an advected face interpolation.