https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
24public:
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
36protected:
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
97public:
99};
Provides common interfaces for flow junction user objects.
Computes flux between two subdomains for 1-phase one-to-one junction.
std::vector< MooseVariable * > _U_vars
Conservative solution variables.
std::vector< unsigned int > _local_side_ids
Local side 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.
const ADVariableValue & _A_linear
Piecewise linear cross-sectional area of connected flow channels.
const MaterialProperty< RealVectorValue > & _dir
Direction material property.
std::vector< std::vector< ADReal > > _primitive_solutions
Primitive solution vectors for each connection.
virtual std::vector< ADReal > computeElementPrimitiveVariables(const Elem *elem) const override
Computes the cell-average primitive variable values for an element.
std::vector< Point > _neighbor_positions
Positions at each connection's neighbor.
std::vector< bool > _has_neighbor
Flags for each connection having a neighbor.
std::vector< std::vector< dof_id_type > > _dof_indices
Degree of freedom indices; first index is connection, second is equation.
std::vector< ADReal > _areas_linear
Piecewise linear areas at each connection.
const std::string & _junction_name
Name of junction component.
static Threads::spin_mutex _spin_mutex
Thread lock.
const SinglePhaseFluidProperties & _fp
fluid properties user object
std::vector< unsigned int > _elem_ids
Element IDs for each connection.
std::vector< unsigned int > _connection_indices
Connection indices for this thread.
std::vector< Point > _positions
Positions at each connection.
virtual void threadJoin(const UserObject &uo) override
std::vector< Real > _delta_x
Position changes for each connection.
std::vector< std::vector< ADReal > > _neighbor_primitive_solutions
Primitive solution vectors for each connection's neighbor.
std::vector< RealVectorValue > _directions
Directions at each connection.
std::vector< std::vector< ADReal > > _fluxes
Flux vector.
const ADNumericalFlux3EqnBase & _numerical_flux
Numerical flux user object.
const std::vector< ADReal > & getFlux(const unsigned int &connection_index) const override
Gets the flux vector for a connection.
Base class for computing numerical fluxes for FlowModelSinglePhase.
Common class for single phase fluid properties.
Interface class for 1-D slope reconstruction.
VariableValueTempl< true > ADVariableValue