https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15class FluidProperties;
21
26{
27public:
29
31
32 virtual void initialize() override;
33 virtual void execute() override;
34 virtual void finalize() override;
35
36protected:
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;
173 const bool _has_2phase;
175 const bool _has_2phase_ncg;
178
185
188
190 const unsigned int & _precision;
191};
User object for querying a single-phase or two-phase fluid properties object.
const SinglePhaseFluidProperties *const _fp_liquid
pointer to liquid fluid properties object (if provided 2-phase object)
void buildJSON2Phase(nlohmann::json &json, const InputParameters &params)
Build 2-phase fluid properties in JSON format.
const TwoPhaseFluidProperties *const _fp_2phase
pointer to 2-phase fluid properties object (if provided 2-phase object)
void outputVaporMixtureStagnationProperties(const InputParameters &params)
Outputs stagnation properties for a vapor mixture fluid properties object.
InputParameters compute2Phase()
Queries a 2-phase fluid properties object.
const bool _has_2phase
flag that user provided 2-phase fluid properties
void outputProperty(const std::string &name, const Real &value, const std::string &units)
Outputs a property value.
void outputASCIIVaporMixture(const InputParameters &params)
Output vapor mixture fluid properties in plain text format.
void outputVaporMixtureStaticProperties(const InputParameters &params)
Outputs static properties for a vapor mixture fluid properties object.
const bool _has_vapor_mixture
flag that user provided vapor mixture fluid properties
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.
const VaporMixtureFluidProperties *const _fp_vapor_mixture
pointer to vapor mixture fluid properties object (if provided 2-phase NCG object)
void outputStaticProperties(const InputParameters &params)
Outputs static properties for a single-phase fluid properties object.
const SinglePhaseFluidProperties *const _fp_vapor
pointer to vapor fluid properties object (if provided 2-phase object)
void outputASCII2Phase(const InputParameters &params)
Output 2-phase fluid properties in plain text format.
bool _nan_encountered
flag that NaN has been encountered
InputParameters compute1Phase(const SinglePhaseFluidProperties *const fp_1phase, bool throw_error_if_no_match)
Queries a 1-phase fluid properties object.
const unsigned int & _precision
Precision used for printing values.
const SinglePhaseFluidProperties *const _fp_1phase
pointer to 1-phase fluid properties object (if provided 1-phase object)
const TwoPhaseNCGFluidProperties *const _fp_2phase_ncg
pointer to 2-phase NCG fluid properties object (if provided 2-phase NCG object)
void outputStagnationProperties(const InputParameters &params)
Outputs stagnation properties for a single-phase fluid properties object.
const bool & _json
true if the output should use JSON format
void outputHeader(const std::string &header) const
Outputs a header for a section of properties.
const bool _has_2phase_ncg_partial_pressure
flag that user provided 2-phase NCG partial pressure fluid properties
void buildJSON1Phase(nlohmann::json &json, const InputParameters &params)
Build 1-phase fluid properties in JSON format.
const bool _has_1phase
flag that user provided 1-phase fluid properties
void outputASCII1Phase(const std::string &description, const InputParameters &params)
Output 1-phase fluid properties in plain text format.
void buildJSONVaporMixture(nlohmann::json &json, const InputParameters &params)
Build vapor mixture fluid properties in JSON format.
const bool _has_2phase_ncg
flag that user provided 2-phase NCG fluid properties
InputParameters computeVaporMixture(bool throw_error_if_no_match)
Queries a vapor mixture fluid properties object.
const TwoPhaseNCGPartialPressureFluidProperties *const _fp_2phase_ncg_partial_pressure
pointer to 2-phase NCG partial pressure fluid properties object (if provided)
const FluidProperties *const _fp
pointer to fluid properties object
const InputParameters & parameters() const
const std::string & name() const
Common class for single phase fluid properties.
Base class for fluid properties used with two-phase flow.
Base class for fluid properties used with 2-phase flow with non-condensable gases (NCGs) present.
Two-phase fluid with single NCG using partial pressure mixture model.
Base class for fluid properties of vapor mixtures.