https://mooseframework.inl.gov
FluidPropertiesInterrogator.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 "GeneralUserObject.h"
13 #include "nlohmann/json.h"
14 
15 class FluidProperties;
21 
26 {
27 public:
29 
31 
32  virtual void initialize() override;
33  virtual void execute() override;
34  virtual void finalize() override;
35 
36 protected:
46  bool throw_error_if_no_match);
47 
55  InputParameters computeVaporMixture(bool throw_error_if_no_match);
56 
63 
75  std::map<std::string, bool>
76  getSpecifiedSetMap(const std::vector<std::vector<std::string>> & parameter_sets,
77  const std::string & fp_type,
78  bool throw_error_if_no_match) const;
79 
83  void buildJSON1Phase(nlohmann::json & json, const InputParameters & params);
84 
88  void buildJSON2Phase(nlohmann::json & json, const InputParameters & params);
89 
93  void buildJSONVaporMixture(nlohmann::json & json, const InputParameters & params);
94 
101  void outputASCII1Phase(const std::string & description, const InputParameters & params);
102 
108  void outputASCII2Phase(const InputParameters & params);
109 
115  void outputASCIIVaporMixture(const InputParameters & params);
116 
120  void outputHeader(const std::string & header) const;
121 
125  void outputProperty(const std::string & name, const Real & value, const std::string & units);
126 
132  void outputStaticProperties(const InputParameters & params);
133 
139  void outputStagnationProperties(const InputParameters & params);
140 
147 
154 
156  const bool & _json;
158  const FluidProperties * const _fp;
167 
169  const bool _has_1phase;
171  const bool _has_vapor_mixture;
173  const bool _has_2phase;
175  const bool _has_2phase_ncg;
178 
185 
188 
190  const unsigned int & _precision;
191 };
Base class for fluid properties of vapor mixtures.
InputParameters computeVaporMixture(bool throw_error_if_no_match)
Queries a vapor mixture fluid properties object.
const SinglePhaseFluidProperties *const _fp_vapor
pointer to vapor fluid properties object (if provided 2-phase object)
void outputVaporMixtureStaticProperties(const InputParameters &params)
Outputs static properties for a vapor mixture fluid properties object.
Two-phase fluid with single NCG using partial pressure mixture model.
const VaporMixtureFluidProperties *const _fp_vapor_mixture
pointer to vapor mixture fluid properties object (if provided 2-phase NCG object) ...
const FluidProperties *const _fp
pointer to fluid properties object
void buildJSON1Phase(nlohmann::json &json, const InputParameters &params)
Build 1-phase fluid properties in JSON format.
Base class for fluid properties used with 2-phase flow with non-condensable gases (NCGs) present...
InputParameters compute1Phase(const SinglePhaseFluidProperties *const fp_1phase, bool throw_error_if_no_match)
Queries a 1-phase fluid properties object.
const TwoPhaseFluidProperties *const _fp_2phase
pointer to 2-phase fluid properties object (if provided 2-phase object)
User object for querying a single-phase or two-phase fluid properties object.
void outputStaticProperties(const InputParameters &params)
Outputs static properties for a single-phase fluid properties object.
const bool _has_2phase_ncg
flag that user provided 2-phase NCG fluid properties
const unsigned int & _precision
Precision used for printing values.
virtual const std::string & name() const
const SinglePhaseFluidProperties *const _fp_liquid
pointer to liquid fluid properties object (if provided 2-phase object)
bool _nan_encountered
flag that NaN has been encountered
void outputProperty(const std::string &name, const Real &value, const std::string &units)
Outputs a property value.
Base class for fluid properties used with two-phase flow.
void outputStagnationProperties(const InputParameters &params)
Outputs stagnation properties for a single-phase fluid properties object.
void outputASCII2Phase(const InputParameters &params)
Output 2-phase fluid properties in plain text format.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void outputASCII1Phase(const std::string &description, const InputParameters &params)
Output 1-phase fluid properties in plain text format.
Common class for single phase fluid properties.
const bool _has_1phase
flag that user provided 1-phase fluid properties
const TwoPhaseNCGFluidProperties *const _fp_2phase_ncg
pointer to 2-phase NCG fluid properties object (if provided 2-phase NCG object)
const TwoPhaseNCGPartialPressureFluidProperties *const _fp_2phase_ncg_partial_pressure
pointer to 2-phase NCG partial pressure fluid properties object (if provided)
void outputASCIIVaporMixture(const InputParameters &params)
Output vapor mixture fluid properties in plain text format.
void buildJSONVaporMixture(nlohmann::json &json, const InputParameters &params)
Build vapor mixture fluid properties in JSON format.
std::map< std::string, bool > getSpecifiedSetMap(const std::vector< std::vector< std::string >> &parameter_sets, const std::string &fp_type, bool throw_error_if_no_match) const
Gets a map of a parameter set to a flag telling whether that set was provided.
void outputVaporMixtureStagnationProperties(const InputParameters &params)
Outputs stagnation properties for a vapor mixture fluid properties object.
FluidPropertiesInterrogator(const InputParameters &parameters)
const bool _has_2phase_ncg_partial_pressure
flag that user provided 2-phase NCG partial pressure fluid properties
const bool _has_vapor_mixture
flag that user provided vapor mixture fluid properties
void outputHeader(const std::string &header) const
Outputs a header for a section of properties.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const bool & _json
true if the output should use JSON format
InputParameters compute2Phase()
Queries a 2-phase fluid properties object.
void buildJSON2Phase(nlohmann::json &json, const InputParameters &params)
Build 2-phase fluid properties in JSON format.
const bool _has_2phase
flag that user provided 2-phase fluid properties
static InputParameters validParams()
const SinglePhaseFluidProperties *const _fp_1phase
pointer to 1-phase fluid properties object (if provided 1-phase object)
const InputParameters & parameters() const