17 #include "metaphysicl/parallel_numberarray.h" 18 #include "metaphysicl/parallel_dualnumber.h" 19 #include "metaphysicl/parallel_semidynamicsparsenumberarray.h" 20 #include "libmesh/parallel_algebra.h" 28 params.
addRequiredParam<std::string>(
"component_name",
"Name of the associated component");
31 params.
addClassDescription(
"Computes and caches flux and residual vectors for a 1-phase junction " 32 "that connects flow channels that are parallel");
41 _p(getADMaterialProperty<
Real>(
"p")),
45 _stored_pA(_n_connections),
46 _areas(_n_connections),
47 _is_inlet(_n_connections),
49 _component_name(getParam<
std::string>(
"component_name"))
68 const Point di =
_dir[0];
69 const Point ni = di * din;
79 const ADReal rhouV2 = rhouV_vec * rhouV_vec;
80 const ADReal eJ = rhoEV / rhoV - 0.5 * rhouV2 / (rhoV * rhoV);
100 ": Connected flow channels are not parallel, use VolumeJunction1Phase " 101 "component instead.");
116 for (
unsigned int i = 0; i < jpc_uo._connection_indices.size(); i++)
118 const unsigned int c = jpc_uo._connection_indices[i];
167 if (Aout_total > Ain_total)
169 if (Aout_total > 1e-15)
171 p_wall = pAout_total / Aout_total;
178 A_wall = Aout_total - Ain_total;
183 if (Ain_total > 1e-15)
185 p_wall = pAin_total / Ain_total;
192 A_wall = Ain_total - Aout_total;
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
std::vector< ADReal > _cached_junction_var_values
void v_from_rhoA_A(Real rhoA, Real A, Real &v, Real &dv_drhoA)
Computes specific volume and its derivatives from rho*A, and area.
virtual void threadJoin(const UserObject &uo) override
virtual void finalize() override
static InputParameters validParams()
const SinglePhaseFluidProperties & _fp
Single-phase fluid properties user object.
std::vector< ADReal > _areas
Areas at each connection.
const Parallel::Communicator & comm() const
virtual void computeFluxesAndResiduals(const unsigned int &c) override
Computes and stores the fluxes, the scalar residuals, and their Jacobians.
unsigned int _n_scalar_eq
Number of scalar residual components.
bool isOutlet(Real vel, Real normal)
Determine if outlet boundary condition should be applied.
std::vector< bool > _is_inlet
Check if the connection is an inlet.
registerMooseObject("ThermalHydraulicsApp", ADJunctionParallelChannels1PhaseUserObject)
Computes and caches flux and residual vectors for a 1-phase junction that connects flow channels that...
std::vector< unsigned int > _c_in
Connection index for inlet flow channel connections.
bool areParallelVectors(const RealVectorValue &a, const RealVectorValue &b, const Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Tests if two real-valued vectors are parallel within some absolute tolerance.
const unsigned int _n_connections
Number of connected flow channels.
RealVectorValue _d_flow
Flow direction for the first connection.
virtual void initialize() override
std::vector< unsigned int > _c_out
Connection index for outlet flow channel connections.
std::vector< ADReal > _residual
Cached scalar residual vector.
const Real & _volume
Volume of the junction.
virtual void computeFluxesAndResiduals(const unsigned int &c) override
Computes and stores the fluxes, the scalar residuals, and their Jacobians.
const MaterialProperty< RealVectorValue > & _dir
Direction of the element connected to the junction.
uint8_t processor_id_type
virtual void threadJoin(const UserObject &uo) override
const ADMaterialProperty< Real > & _p
Pressure material property.
static InputParameters validParams()
ADJunctionParallelChannels1PhaseUserObject(const InputParameters ¶ms)
Computes and caches flux and residual vectors for a 1-phase volume junction.
std::vector< unsigned int > _processor_ids
Owners of each side of the junction.
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
const ADVariableValue & _A
Cross-sectional area of connected flow channels.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void initialize() override
std::vector< ADReal > _stored_pA
RealVectorValue _dir_c0
Channel direction for the first connection.
void mooseError(Args &&... args) const
const std::vector< Real > & _normal
Flow channel outward normals or junction inward normals.
const ADVariableValue & _rhouA
rho*u*A of the connected flow channels
std::vector< unsigned int > _c_wall
Connection index for connections that contribute to the wall pressure.
const std::string & _component_name
Name of the associated component.