https://mooseframework.inl.gov
INSFVVariable.h
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 #pragma once
11 
12 #include "MooseVariableFV.h"
13 
14 class InputParameters;
16 
18 {
19 public:
20  INSFVVariable(const InputParameters & params);
21 
23 
24  // The INSFV system relies on on-the-fly functor evaluation and does not need any pre-init'd data
25  void computeFaceValues(const FaceInfo &) override;
26  void computeElemValues() override;
27  void computeElemValuesFace() override;
28  void computeNeighborValuesFace() override;
29  void computeNeighborValues() override;
30  void requireQpComputations() const override { _qp_calculations = true; }
31  bool supportsQpBasedLoops() const override { return _qp_calculations; }
32  bool supportsGeometricInfoBasedLoops() const override { return true; }
33  virtual void initialSetup() override;
34  virtual void timestepSetup() override;
35  virtual void meshChanged() override;
36 
37  // If the given boundary is a hydraulic separator bouundary for this variable
38  bool isSeparatorBoundary(const FaceInfo & fi) const;
39 
40  bool isExtrapolatedBoundaryFace(const FaceInfo & fi,
41  const Elem * elem,
42  const Moose::StateArg & time) const override;
43 
44 protected:
48  bool isFullyDevelopedFlowFace(const FaceInfo & fi) const;
49 
54 
57  std::unordered_map<BoundaryID, const INSFVHydraulicSeparatorInterface *>
59 
60 private:
64  mutable bool _qp_calculations;
65 };
66 
67 inline void
69 {
70  if (_qp_calculations)
72 }
73 
74 inline void
76 {
77  if (_qp_calculations)
79  else
80  _element_data->setGeometry(Moose::Volume);
81 }
82 
83 inline void
85 {
86  if (_qp_calculations)
88 }
89 
90 inline void
92 {
93  if (_qp_calculations)
95 }
96 
97 inline void
99 {
100  if (_qp_calculations)
102 }
void computeElemValues() override
Definition: INSFVVariable.h:75
bool supportsGeometricInfoBasedLoops() const override
Definition: INSFVVariable.h:32
virtual void computeNeighborValues() override
void computeNeighborValuesFace() override
Definition: INSFVVariable.h:91
bool supportsQpBasedLoops() const override
Definition: INSFVVariable.h:31
bool _qp_calculations
Whether to pre-initialize variable data for use in traditional MOOSE quadrature point based objects...
Definition: INSFVVariable.h:64
bool isExtrapolatedBoundaryFace(const FaceInfo &fi, const Elem *elem, const Moose::StateArg &time) const override
Definition: INSFVVariable.C:92
bool isSeparatorBoundary(const FaceInfo &fi) const
Definition: INSFVVariable.C:82
virtual void initialSetup() override
Definition: INSFVVariable.C:75
std::unordered_map< BoundaryID, const INSFVHydraulicSeparatorInterface * > _boundary_id_to_separator
A container for quick access of hydraulic separator BCs associated with this variable.
Definition: INSFVVariable.h:58
std::unique_ptr< MooseVariableDataFV< Real > > _element_data
INSFVVariable(const InputParameters &params)
Definition: INSFVVariable.C:29
void requireQpComputations() const override
Definition: INSFVVariable.h:30
virtual void computeFaceValues(const FaceInfo &fi) override
virtual void meshChanged() override
Definition: INSFVVariable.C:68
void computeElemValuesFace() override
Definition: INSFVVariable.h:84
static InputParameters validParams()
Definition: INSFVVariable.C:24
void cacheSeparatorBoundaries()
Caches the separator boundaries.
Definition: INSFVVariable.C:35
A base class which serves as a tag for hydraulic separators.
virtual void timestepSetup() override
Definition: INSFVVariable.C:61
virtual void computeElemValues() override
void computeNeighborValues() override
Definition: INSFVVariable.h:98
virtual void computeElemValuesFace() override
void computeFaceValues(const FaceInfo &) override
Definition: INSFVVariable.h:68
virtual void computeNeighborValuesFace() override
bool isFullyDevelopedFlowFace(const FaceInfo &fi) const
Returns whether the passed-in FaceInfo corresponds to a fully-developed flow face.