www.mooseframework.org
FluidPropertiesInterrogator.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "json/json.h"
14 
16 class FluidProperties;
21 
22 template <>
24 
28 class FluidPropertiesInterrogator : public GeneralUserObject
29 {
30 public:
31  FluidPropertiesInterrogator(const InputParameters & parameters);
32 
33  virtual void initialize() override;
34  virtual void execute() override;
35  virtual void finalize() override;
36 
37 protected:
46  InputParameters compute1Phase(const SinglePhaseFluidProperties * const fp_1phase,
47  bool throw_error_if_no_match);
48 
56  InputParameters computeVaporMixture(bool throw_error_if_no_match);
57 
63  InputParameters compute2Phase();
64 
76  std::map<std::string, bool>
77  getSpecifiedSetMap(const std::vector<std::vector<std::string>> & parameter_sets,
78  const std::string & fp_type,
79  bool throw_error_if_no_match) const;
80 
84  void buildJSON1Phase(moosecontrib::Json::Value & json, const InputParameters & params);
85 
89  void buildJSON2Phase(moosecontrib::Json::Value & json, const InputParameters & params);
90 
94  void buildJSONVaporMixture(moosecontrib::Json::Value & json, const InputParameters & params);
95 
102  void outputASCII1Phase(const std::string & description, const InputParameters & params);
103 
109  void outputASCII2Phase(const InputParameters & params);
110 
116  void outputASCIIVaporMixture(const InputParameters & params);
117 
121  void outputHeader(const std::string & header) const;
122 
126  void outputProperty(const std::string & name, const Real & value, const std::string & units);
127 
133  void outputStaticProperties(const InputParameters & params);
134 
140  void outputStagnationProperties(const InputParameters & params);
141 
147  void outputVaporMixtureStaticProperties(const InputParameters & params);
148 
154  void outputVaporMixtureStagnationProperties(const InputParameters & params);
155 
157  const bool & _json;
159  const FluidProperties * const _fp;
166 
168  const bool _has_1phase;
170  const bool _has_vapor_mixture;
172  const bool _has_2phase;
174  const bool _has_2phase_ncg;
175 
182 
185 
187  const unsigned int & _precision;
188 };
FluidPropertiesInterrogator::outputHeader
void outputHeader(const std::string &header) const
Outputs a header for a section of properties.
Definition: FluidPropertiesInterrogator.C:659
FluidPropertiesInterrogator::outputASCII1Phase
void outputASCII1Phase(const std::string &description, const InputParameters &params)
Output 1-phase fluid properties in plain text format.
Definition: FluidPropertiesInterrogator.C:531
FluidPropertiesInterrogator::outputVaporMixtureStaticProperties
void outputVaporMixtureStaticProperties(const InputParameters &params)
Outputs static properties for a vapor mixture fluid properties object.
Definition: FluidPropertiesInterrogator.C:739
FluidPropertiesInterrogator::_nan_encountered
bool _nan_encountered
flag that NaN has been encountered
Definition: FluidPropertiesInterrogator.h:184
FluidPropertiesInterrogator::outputProperty
void outputProperty(const std::string &name, const Real &value, const std::string &units)
Outputs a property value.
Definition: FluidPropertiesInterrogator.C:668
FluidPropertiesInterrogator::compute1Phase
InputParameters compute1Phase(const SinglePhaseFluidProperties *const fp_1phase, bool throw_error_if_no_match)
Queries a 1-phase fluid properties object.
Definition: FluidPropertiesInterrogator.C:186
FluidPropertiesInterrogator::execute
virtual void execute() override
Definition: FluidPropertiesInterrogator.C:80
SinglePhaseFluidProperties
Common class for single phase fluid properties.
Definition: SinglePhaseFluidProperties.h:89
FluidPropertiesInterrogator::outputVaporMixtureStagnationProperties
void outputVaporMixtureStagnationProperties(const InputParameters &params)
Outputs stagnation properties for a vapor mixture fluid properties object.
Definition: FluidPropertiesInterrogator.C:757
FluidPropertiesInterrogator::_fp_vapor_mixture
const VaporMixtureFluidProperties *const _fp_vapor_mixture
pointer to vapor mixture fluid properties object (if provided 2-phase NCG object)
Definition: FluidPropertiesInterrogator.h:181
FluidPropertiesInterrogator::initialize
virtual void initialize() override
Definition: FluidPropertiesInterrogator.C:75
FluidPropertiesInterrogator
User object for querying a single-phase or two-phase fluid properties object.
Definition: FluidPropertiesInterrogator.h:28
FluidPropertiesInterrogator::_fp_1phase
const SinglePhaseFluidProperties *const _fp_1phase
pointer to 1-phase fluid properties object (if provided 1-phase object)
Definition: FluidPropertiesInterrogator.h:161
FluidPropertiesInterrogator::buildJSON1Phase
void buildJSON1Phase(moosecontrib::Json::Value &json, const InputParameters &params)
Build 1-phase fluid properties in JSON format.
Definition: FluidPropertiesInterrogator.C:484
FluidPropertiesInterrogator::buildJSON2Phase
void buildJSON2Phase(moosecontrib::Json::Value &json, const InputParameters &params)
Build 2-phase fluid properties in JSON format.
Definition: FluidPropertiesInterrogator.C:509
FluidPropertiesInterrogator::_fp_liquid
const SinglePhaseFluidProperties *const _fp_liquid
pointer to liquid fluid properties object (if provided 2-phase object)
Definition: FluidPropertiesInterrogator.h:177
FluidPropertiesInterrogator::computeVaporMixture
InputParameters computeVaporMixture(bool throw_error_if_no_match)
Queries a vapor mixture fluid properties object.
Definition: FluidPropertiesInterrogator.C:379
FluidPropertiesInterrogator::_fp_vapor
const SinglePhaseFluidProperties *const _fp_vapor
pointer to vapor fluid properties object (if provided 2-phase object)
Definition: FluidPropertiesInterrogator.h:179
FluidPropertiesInterrogator::FluidPropertiesInterrogator
FluidPropertiesInterrogator(const InputParameters &parameters)
Definition: FluidPropertiesInterrogator.C:43
name
const std::string name
Definition: Setup.h:21
FluidPropertiesInterrogator::_has_vapor_mixture
const bool _has_vapor_mixture
flag that user provided vapor mixture fluid properties
Definition: FluidPropertiesInterrogator.h:170
FluidPropertiesInterrogator::_has_2phase
const bool _has_2phase
flag that user provided 2-phase fluid properties
Definition: FluidPropertiesInterrogator.h:172
TwoPhaseNCGFluidProperties
Base class for fluid properties used with 2-phase flow with non-condensable gases (NCGs) present.
Definition: TwoPhaseNCGFluidProperties.h:24
FluidPropertiesInterrogator::outputASCIIVaporMixture
void outputASCIIVaporMixture(const InputParameters &params)
Output vapor mixture fluid properties in plain text format.
Definition: FluidPropertiesInterrogator.C:563
TwoPhaseFluidProperties
Base class for fluid properties used with two-phase flow.
Definition: TwoPhaseFluidProperties.h:23
FluidPropertiesInterrogator::_fp_2phase
const TwoPhaseFluidProperties *const _fp_2phase
pointer to 2-phase fluid properties object (if provided 2-phase object)
Definition: FluidPropertiesInterrogator.h:163
FluidPropertiesInterrogator::getSpecifiedSetMap
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.
Definition: FluidPropertiesInterrogator.C:578
FluidPropertiesInterrogator::outputASCII2Phase
void outputASCII2Phase(const InputParameters &params)
Output 2-phase fluid properties in plain text format.
Definition: FluidPropertiesInterrogator.C:547
FluidPropertiesInterrogator::compute2Phase
InputParameters compute2Phase()
Queries a 2-phase fluid properties object.
Definition: FluidPropertiesInterrogator.C:325
FluidProperties
Definition: FluidProperties.h:28
FluidPropertiesInterrogator::buildJSONVaporMixture
void buildJSONVaporMixture(moosecontrib::Json::Value &json, const InputParameters &params)
Build vapor mixture fluid properties in JSON format.
Definition: FluidPropertiesInterrogator.C:519
FluidPropertiesInterrogator::_json
const bool & _json
true if the output should use JSON format
Definition: FluidPropertiesInterrogator.h:157
FluidPropertiesInterrogator::_fp
const FluidProperties *const _fp
pointer to fluid properties object
Definition: FluidPropertiesInterrogator.h:159
FluidPropertiesInterrogator::_has_1phase
const bool _has_1phase
flag that user provided 1-phase fluid properties
Definition: FluidPropertiesInterrogator.h:168
FluidPropertiesInterrogator::_fp_2phase_ncg
const TwoPhaseNCGFluidProperties *const _fp_2phase_ncg
pointer to 2-phase NCG fluid properties object (if provided 2-phase NCG object)
Definition: FluidPropertiesInterrogator.h:165
FluidPropertiesInterrogator::outputStagnationProperties
void outputStagnationProperties(const InputParameters &params)
Outputs stagnation properties for a single-phase fluid properties object.
Definition: FluidPropertiesInterrogator.C:719
FluidPropertiesInterrogator::finalize
virtual void finalize() override
Definition: FluidPropertiesInterrogator.C:181
FluidPropertiesInterrogator::outputStaticProperties
void outputStaticProperties(const InputParameters &params)
Outputs static properties for a single-phase fluid properties object.
Definition: FluidPropertiesInterrogator.C:699
VaporMixtureFluidProperties
Base class for fluid properties of vapor mixtures.
Definition: VaporMixtureFluidProperties.h:27
FluidPropertiesInterrogator::_has_2phase_ncg
const bool _has_2phase_ncg
flag that user provided 2-phase NCG fluid properties
Definition: FluidPropertiesInterrogator.h:174
validParams< FluidPropertiesInterrogator >
InputParameters validParams< FluidPropertiesInterrogator >()
Definition: FluidPropertiesInterrogator.C:21
FluidPropertiesInterrogator::_precision
const unsigned int & _precision
Precision used for printing values.
Definition: FluidPropertiesInterrogator.h:187