https://mooseframework.inl.gov
ADJunctionOneToOne1PhaseUserObject.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 
14 
17 
23 {
24 public:
26 
27  virtual void initialize() override;
28  virtual void execute() override;
29  virtual void threadJoin(const UserObject & uo) override;
30  virtual void finalize() override;
31 
32  const std::vector<ADReal> & getFlux(const unsigned int & connection_index) const override;
33 
34  virtual std::vector<ADReal> computeElementPrimitiveVariables(const Elem * elem) const override;
35 
36 protected:
39 
40  // piecewise constant conserved variables
46  std::vector<MooseVariable *> _U_vars;
47 
50 
53 
55  const std::string & _junction_name;
56 
59 
61  std::vector<std::vector<ADReal>> _primitive_solutions;
63  std::vector<std::vector<ADReal>> _neighbor_primitive_solutions;
64 
66  std::vector<std::vector<ADReal>> _fluxes;
68  std::vector<std::vector<dof_id_type>> _dof_indices;
69 
71  std::vector<unsigned int> _elem_ids;
73  std::vector<unsigned int> _local_side_ids;
74 
76  std::vector<ADReal> _areas_linear;
78  std::vector<RealVectorValue> _directions;
80  std::vector<Point> _positions;
82  std::vector<Point> _neighbor_positions;
84  std::vector<Real> _delta_x;
86  std::vector<bool> _has_neighbor;
87 
89  std::vector<unsigned int> _connection_indices;
90 
92  static const std::vector<std::pair<std::string, unsigned int>> _varname_eq_index_pairs;
93 
95  static Threads::spin_mutex _spin_mutex;
96 
97 public:
99 };
const ADVariableValue & _A_linear
Piecewise linear cross-sectional area of connected flow channels.
std::vector< RealVectorValue > _directions
Directions at each connection.
std::vector< Point > _positions
Positions at each connection.
virtual std::vector< ADReal > computeElementPrimitiveVariables(const Elem *elem) const override
Computes the cell-average primitive variable values for an element.
std::vector< std::vector< dof_id_type > > _dof_indices
Degree of freedom indices; first index is connection, second is equation.
virtual void threadJoin(const UserObject &uo) override
const std::string & _junction_name
Name of junction component.
std::vector< std::vector< ADReal > > _fluxes
Flux vector.
std::vector< unsigned int > _elem_ids
Element IDs for each connection.
static const std::vector< std::pair< std::string, unsigned int > > _varname_eq_index_pairs
Pairs of variable names vs. their corresponding equation indices.
std::vector< bool > _has_neighbor
Flags for each connection having a neighbor.
std::vector< std::vector< ADReal > > _primitive_solutions
Primitive solution vectors for each connection.
const std::vector< ADReal > & getFlux(const unsigned int &connection_index) const override
Gets the flux vector for a connection.
std::vector< unsigned int > _connection_indices
Connection indices for this thread.
std::vector< ADReal > _areas_linear
Piecewise linear areas at each connection.
Common class for single phase fluid properties.
Base class for computing numerical fluxes for FlowModelSinglePhase.
Computes flux between two subdomains for 1-phase one-to-one junction.
Provides common interfaces for flow junction user objects.
std::vector< MooseVariable * > _U_vars
Conservative solution variables.
std::vector< std::vector< ADReal > > _neighbor_primitive_solutions
Primitive solution vectors for each connection&#39;s neighbor.
Interface class for 1-D slope reconstruction.
const SinglePhaseFluidProperties & _fp
fluid properties user object
std::vector< Real > _delta_x
Position changes for each connection.
const MaterialProperty< RealVectorValue > & _dir
Direction material property.
const ADNumericalFlux3EqnBase & _numerical_flux
Numerical flux user object.
std::vector< Point > _neighbor_positions
Positions at each connection&#39;s neighbor.
std::vector< unsigned int > _local_side_ids
Local side IDs for each connection.
ADJunctionOneToOne1PhaseUserObject(const InputParameters &params)
static Threads::spin_mutex _spin_mutex
Thread lock.