User object for querying a single-phase or two-phase fluid properties object.
More...
#include <FluidPropertiesInterrogator.h>
|
InputParameters | compute1Phase (const SinglePhaseFluidProperties *const fp_1phase, bool throw_error_if_no_match) |
| Queries a 1-phase fluid properties object. More...
|
|
InputParameters | computeVaporMixture (bool throw_error_if_no_match) |
| Queries a vapor mixture fluid properties object. More...
|
|
InputParameters | compute2Phase () |
| Queries a 2-phase fluid properties object. More...
|
|
std::map< std::string, bool > | getSpecifiedSetMap (const std::vector< std::vector< std::string >> ¶meter_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. More...
|
|
void | buildJSON1Phase (moosecontrib::Json::Value &json, const InputParameters ¶ms) |
| Build 1-phase fluid properties in JSON format. More...
|
|
void | buildJSON2Phase (moosecontrib::Json::Value &json, const InputParameters ¶ms) |
| Build 2-phase fluid properties in JSON format. More...
|
|
void | buildJSONVaporMixture (moosecontrib::Json::Value &json, const InputParameters ¶ms) |
| Build vapor mixture fluid properties in JSON format. More...
|
|
void | outputASCII1Phase (const std::string &description, const InputParameters ¶ms) |
| Output 1-phase fluid properties in plain text format. More...
|
|
void | outputASCII2Phase (const InputParameters ¶ms) |
| Output 2-phase fluid properties in plain text format. More...
|
|
void | outputASCIIVaporMixture (const InputParameters ¶ms) |
| Output vapor mixture fluid properties in plain text format. More...
|
|
void | outputHeader (const std::string &header) const |
| Outputs a header for a section of properties. More...
|
|
void | outputProperty (const std::string &name, const Real &value, const std::string &units) |
| Outputs a property value. More...
|
|
void | outputStaticProperties (const InputParameters ¶ms) |
| Outputs static properties for a single-phase fluid properties object. More...
|
|
void | outputStagnationProperties (const InputParameters ¶ms) |
| Outputs stagnation properties for a single-phase fluid properties object. More...
|
|
void | outputVaporMixtureStaticProperties (const InputParameters ¶ms) |
| Outputs static properties for a vapor mixture fluid properties object. More...
|
|
void | outputVaporMixtureStagnationProperties (const InputParameters ¶ms) |
| Outputs stagnation properties for a vapor mixture fluid properties object. More...
|
|
User object for querying a single-phase or two-phase fluid properties object.
Definition at line 28 of file FluidPropertiesInterrogator.h.
◆ FluidPropertiesInterrogator()
FluidPropertiesInterrogator::FluidPropertiesInterrogator |
( |
const InputParameters & |
parameters | ) |
|
Definition at line 43 of file FluidPropertiesInterrogator.C.
44 : GeneralUserObject(parameters),
45 _json(getParam<bool>(
"json")),
46 _fp(&getUserObject<FluidProperties>(
"fp")),
47 _fp_1phase(dynamic_cast<const SinglePhaseFluidProperties * const>(
_fp)),
48 _fp_2phase(dynamic_cast<const TwoPhaseFluidProperties * const>(
_fp)),
61 ? dynamic_cast<const VaporMixtureFluidProperties * const>(
_fp)
66 _precision(getParam<unsigned int>(
"precision"))
70 "The type of the parameter 'fp' must be derived from type 'SinglePhaseFluidProperties', "
71 "'VaporMixtureFluidProperties', or 'TwoPhaseFluidProperties'.");
◆ buildJSON1Phase()
void FluidPropertiesInterrogator::buildJSON1Phase |
( |
moosecontrib::Json::Value & |
json, |
|
|
const InputParameters & |
params |
|
) |
| |
|
protected |
Build 1-phase fluid properties in JSON format.
Definition at line 484 of file FluidPropertiesInterrogator.C.
487 for (
auto p : {
"rho",
"e",
"p",
"T",
"v",
"h",
"s",
"c",
"mu",
"cp",
"cv",
"k",
"beta"})
488 json[
"static"][p] = params.get<Real>(p);
490 if (params.have_parameter<Real>(
"vel"))
491 for (
auto p : {
"vel",
505 json[
"stagnation"][p] = params.get<Real>(p);
Referenced by execute().
◆ buildJSON2Phase()
void FluidPropertiesInterrogator::buildJSON2Phase |
( |
moosecontrib::Json::Value & |
json, |
|
|
const InputParameters & |
params |
|
) |
| |
|
protected |
Build 2-phase fluid properties in JSON format.
Definition at line 509 of file FluidPropertiesInterrogator.C.
512 json[
"p_critical"] = params.get<Real>(
"p_critical");
513 for (
auto p : {
"T_sat",
"p_sat",
"h_lat",
"sigma"})
514 if (params.have_parameter<Real>(p))
515 json[p] = params.get<Real>(p);
Referenced by execute().
◆ buildJSONVaporMixture()
void FluidPropertiesInterrogator::buildJSONVaporMixture |
( |
moosecontrib::Json::Value & |
json, |
|
|
const InputParameters & |
params |
|
) |
| |
|
protected |
Build vapor mixture fluid properties in JSON format.
Definition at line 519 of file FluidPropertiesInterrogator.C.
522 for (
auto p : {
"p",
"T",
"rho",
"e",
"v",
"h",
"c",
"mu",
"cp",
"cv",
"k"})
523 if (params.have_parameter<Real>(p))
524 json[
"static"][p] = params.get<Real>(p);
526 if (params.have_parameter<Real>(
"vel"))
527 json[
"stagnation"][
"h0"] = params.get<Real>(
"h0");
Referenced by execute().
◆ compute1Phase()
InputParameters FluidPropertiesInterrogator::compute1Phase |
( |
const SinglePhaseFluidProperties *const |
fp_1phase, |
|
|
bool |
throw_error_if_no_match |
|
) |
| |
|
protected |
Queries a 1-phase fluid properties object.
- Returns
- Input parameters holding the computed values
- Parameters
-
[in] | fp_1phase | 1-phase fluid properties |
[in] | throw_error_if_no_match | Option to throw an error if no sets match the inputs |
Definition at line 186 of file FluidPropertiesInterrogator.C.
189 InputParameters params = emptyInputParameters();
195 std::vector<std::vector<std::string>> parameter_sets = {{
"p",
"T"}, {
"rho",
"e"}, {
"rho",
"p"}};
197 parameter_sets.push_back({
"rho",
"rhou",
"rhoE"});
198 auto specified =
getSpecifiedSetMap(parameter_sets,
"one-phase", throw_error_if_no_match);
202 Real rho, e, p, T, vel = 0;
203 bool specified_a_set =
false;
204 if (specified[
"rho,e"])
206 rho = getParam<Real>(
"rho");
207 e = getParam<Real>(
"e");
208 const Real v = 1.0 / rho;
209 p = fp_1phase->p_from_v_e(v, e);
210 T = fp_1phase->T_from_v_e(v, e);
211 if (isParamValid(
"vel"))
212 vel = getParam<Real>(
"vel");
214 specified_a_set =
true;
216 else if (specified[
"rho,p"])
218 rho = getParam<Real>(
"rho");
219 p = getParam<Real>(
"p");
220 const Real v = 1.0 / rho;
221 e = fp_1phase->e_from_p_rho(p, rho);
222 T = fp_1phase->T_from_v_e(v, e);
223 if (isParamValid(
"vel"))
224 vel = getParam<Real>(
"vel");
226 specified_a_set =
true;
228 else if (specified[
"p,T"])
230 p = getParam<Real>(
"p");
231 T = getParam<Real>(
"T");
232 rho = fp_1phase->rho_from_p_T(p, T);
233 e = fp_1phase->e_from_p_rho(p, rho);
234 if (isParamValid(
"vel"))
235 vel = getParam<Real>(
"vel");
237 specified_a_set =
true;
239 else if (specified[
"rho,rhou,rhoE"])
241 rho = getParam<Real>(
"rho");
242 const Real rhou = getParam<Real>(
"rhou");
243 const Real rhoE = getParam<Real>(
"rhoE");
246 const Real E = rhoE / rho;
247 e = E - 0.5 * vel * vel;
249 const Real v = 1.0 / rho;
250 p = fp_1phase->p_from_v_e(v, e);
251 T = fp_1phase->T_from_v_e(v, e);
253 specified_a_set =
true;
258 params.set<
bool>(
"specified") =
true;
260 const Real v = 1.0 / rho;
262 params.set<Real>(
"rho") = rho;
263 params.set<Real>(
"e") = e;
264 params.set<Real>(
"p") = p;
265 params.set<Real>(
"T") = T;
266 params.set<Real>(
"v") = v;
267 params.set<Real>(
"h") = fp_1phase->h_from_p_T(p, T);
268 params.set<Real>(
"s") = fp_1phase->s_from_v_e(v, e);
269 params.set<Real>(
"c") = fp_1phase->c_from_v_e(v, e);
270 params.set<Real>(
"mu") = fp_1phase->mu_from_v_e(v, e);
271 params.set<Real>(
"cp") = fp_1phase->cp_from_v_e(v, e);
272 params.set<Real>(
"cv") = fp_1phase->cv_from_v_e(v, e);
273 params.set<Real>(
"k") = fp_1phase->k_from_v_e(v, e);
274 params.set<Real>(
"beta") = fp_1phase->beta_from_p_T(p, T);
276 if (isParamValid(
"vel") || specified[
"rho,rhou,rhoE"])
278 const Real s = fp_1phase->s_from_v_e(v, e);
280 const Real h = fp_1phase->h_from_p_T(p, T);
281 const Real h0 = h + 0.5 * vel * vel;
282 const Real p0 = fp_1phase->p_from_h_s(h0, s0);
283 const Real rho0 = fp_1phase->rho_from_p_s(p0, s0);
284 const Real e0 = fp_1phase->e_from_p_rho(p0, rho0);
285 const Real v0 = 1.0 / rho0;
286 const Real T0 = fp_1phase->T_from_v_e(v0, e0);
287 const Real c0 = fp_1phase->c_from_v_e(v0, e0);
288 const Real mu0 = fp_1phase->mu_from_v_e(v0, e0);
289 const Real cp0 = fp_1phase->cp_from_v_e(v0, e0);
290 const Real cv0 = fp_1phase->cv_from_v_e(v0, e0);
291 const Real k0 = fp_1phase->k_from_v_e(v0, e0);
292 const Real beta0 = fp_1phase->beta_from_p_T(p0, T0);
294 params.set<Real>(
"vel") = vel;
295 params.set<Real>(
"rho0") = rho0;
296 params.set<Real>(
"s0") = s0;
297 params.set<Real>(
"v0") = v0;
298 params.set<Real>(
"e0") = e0;
299 params.set<Real>(
"h0") = h0;
300 params.set<Real>(
"p0") = p0;
301 params.set<Real>(
"T0") = T0;
302 params.set<Real>(
"c0") = c0;
303 params.set<Real>(
"mu0") = mu0;
304 params.set<Real>(
"cp0") = cp0;
305 params.set<Real>(
"cv0") = cv0;
306 params.set<Real>(
"k0") = k0;
307 params.set<Real>(
"beta0") = beta0;
313 "At least one NaN was encountered. This implies one of the following:\n",
314 " 1. The specified thermodynamic state is inconsistent with the equation of state\n",
315 " (for example, the state corresponds to a different phase of the fluid).\n",
316 " 2. There is a problem with the equation of state package at this state\n",
317 " (for example, the supplied state is outside of the valid state space\n",
318 " that was programmed in the package).");
Referenced by execute().
◆ compute2Phase()
InputParameters FluidPropertiesInterrogator::compute2Phase |
( |
| ) |
|
|
protected |
Queries a 2-phase fluid properties object.
- Returns
- Input parameters holding the computed values
Definition at line 325 of file FluidPropertiesInterrogator.C.
327 InputParameters params = emptyInputParameters();
333 std::vector<std::vector<std::string>> parameter_sets = {{
"p",
"T"}, {
"p"}, {
"T"}};
337 params.set<Real>(
"p_critical") = p_critical;
340 const Real p = getParam<Real>(
"p");
344 params.set<Real>(
"p") = p;
345 params.set<Real>(
"T_sat") = T_sat;
346 params.set<Real>(
"h_lat") = h_lat;
348 else if (specified[
"T"])
350 const Real T = getParam<Real>(
"T");
355 params.set<Real>(
"T") = T;
356 params.set<Real>(
"p_sat") = p_sat;
357 params.set<Real>(
"h_lat") = h_lat;
358 params.set<Real>(
"sigma") = sigma;
360 else if (specified[
"p,T"])
362 const Real p = getParam<Real>(
"p");
363 const Real T = getParam<Real>(
"T");
366 params.set<Real>(
"p") = p;
367 params.set<Real>(
"T") = T;
368 params.set<Real>(
"h_lat") = h_lat;
373 mooseWarning(
"At least one NaN was encountered.");
Referenced by execute().
◆ computeVaporMixture()
InputParameters FluidPropertiesInterrogator::computeVaporMixture |
( |
bool |
throw_error_if_no_match | ) |
|
|
protected |
Queries a vapor mixture fluid properties object.
- Returns
- Input parameters holding the computed values
- Parameters
-
[in] | throw_error_if_no_match | Option to throw an error if no sets match the inputs |
Definition at line 379 of file FluidPropertiesInterrogator.C.
381 InputParameters params = emptyInputParameters();
387 std::vector<std::vector<std::string>> parameter_sets = {
388 {
"p",
"T",
"x_ncg"}, {
"rho",
"e",
"x_ncg"}, {
"rho",
"rhou",
"rhoE",
"x_ncg"}};
389 auto specified =
getSpecifiedSetMap(parameter_sets,
"vapor mixture", throw_error_if_no_match);
391 const auto x_ncg = getParam<std::vector<Real>>(
"x_ncg");
395 Real rho, e, p, T, vel = 0;
396 bool specified_a_set =
false;
397 if (specified[
"rho,e,x_ncg"])
399 rho = getParam<Real>(
"rho");
400 e = getParam<Real>(
"e");
401 const Real v = 1.0 / rho;
404 if (isParamValid(
"vel"))
405 vel = getParam<Real>(
"vel");
407 specified_a_set =
true;
409 else if (specified[
"p,T,x_ncg"])
411 p = getParam<Real>(
"p");
412 T = getParam<Real>(
"T");
415 if (isParamValid(
"vel"))
416 vel = getParam<Real>(
"vel");
418 specified_a_set =
true;
420 else if (specified[
"rho,rhou,rhoE,x_ncg"])
422 rho = getParam<Real>(
"rho");
423 const Real rhou = getParam<Real>(
"rhou");
424 const Real rhoE = getParam<Real>(
"rhoE");
427 const Real E = rhoE / rho;
428 e = E - 0.5 * vel * vel;
430 const Real v = 1.0 / rho;
434 specified_a_set =
true;
439 params.set<
bool>(
"specified") =
true;
441 const Real v = 1.0 / rho;
442 const Real h = e + p / rho;
449 params.set<Real>(
"p") = p;
450 params.set<Real>(
"T") = T;
451 params.set<Real>(
"rho") = rho;
452 params.set<Real>(
"e") = e;
453 params.set<Real>(
"v") = v;
454 params.set<Real>(
"h") = h;
455 params.set<Real>(
"c") = c;
456 params.set<Real>(
"mu") = mu;
457 params.set<Real>(
"cp") = cp;
458 params.set<Real>(
"cv") = cv;
459 params.set<Real>(
"k") = k;
461 if (isParamValid(
"vel") || specified[
"rho,rhou,rhoE,x_ncg"])
463 const Real h = e + p / rho;
464 const Real h0 = h + 0.5 * vel * vel;
466 params.set<Real>(
"h0") = h0;
472 "At least one NaN was encountered. This implies one of the following:\n",
473 " 1. The specified thermodynamic state is inconsistent with the equation of state\n",
474 " (for example, the state corresponds to a different phase of the fluid).\n",
475 " 2. There is a problem with the equation of state package at this state\n",
476 " (for example, the supplied state is outside of the valid state space\n",
477 " that was programmed in the package).");
Referenced by execute().
◆ execute()
void FluidPropertiesInterrogator::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 80 of file FluidPropertiesInterrogator.C.
90 moosecontrib::Json::Value json;
92 auto & json_2phase = json[
"2-phase"];
94 auto & json_liquid = json[
"liquid"];
96 auto & json_mixture = json[
"vapor-mixture"];
99 Moose::out <<
"**START JSON DATA**\n";
100 Moose::out << json <<
"\n";
101 Moose::out <<
"**END JSON DATA**\n";
118 moosecontrib::Json::Value json;
120 auto & json_2phase = json[
"2-phase"];
122 if (pars_liquid.have_parameter<
bool>(
"specified"))
124 auto & json_liquid = json[
"liquid"];
127 if (pars_vapor.have_parameter<
bool>(
"specified"))
129 auto & json_vapor = json[
"vapor"];
133 Moose::out <<
"**START JSON DATA**\n";
134 Moose::out << json <<
"\n";
135 Moose::out <<
"**END JSON DATA**\n";
140 if (pars_liquid.have_parameter<
bool>(
"specified"))
142 if (pars_vapor.have_parameter<
bool>(
"specified"))
151 moosecontrib::Json::Value json;
154 Moose::out <<
"**START JSON DATA**\n";
155 Moose::out << json <<
"\n";
156 Moose::out <<
"**END JSON DATA**\n";
167 moosecontrib::Json::Value json;
171 Moose::out <<
"**START JSON DATA**\n";
172 Moose::out << json <<
"\n";
173 Moose::out <<
"**END JSON DATA**\n";
◆ finalize()
void FluidPropertiesInterrogator::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getSpecifiedSetMap()
std::map< std::string, bool > FluidPropertiesInterrogator::getSpecifiedSetMap |
( |
const std::vector< std::vector< std::string >> & |
parameter_sets, |
|
|
const std::string & |
fp_type, |
|
|
bool |
throw_error_if_no_match |
|
) |
| const |
|
protected |
Gets a map of a parameter set to a flag telling whether that set was provided.
- Parameters
-
[in] | parameter_sets | vector of vectors of strings of parameter names. The first dimension is the parameter set, and the second dimension is a parameter within the set. If a set is a subset of another set, the subset should be after the other. |
[in] | fp_type | string used to identify the set of parameter sets |
[in] | throw_error_if_no_match | Option to throw an error if no sets match the inputs |
Definition at line 578 of file FluidPropertiesInterrogator.C.
584 std::vector<std::string> parameter_union;
585 for (
auto & parameter_set : parameter_sets)
586 parameter_union.insert(parameter_union.end(), parameter_set.begin(), parameter_set.end());
587 std::sort(parameter_union.begin(), parameter_union.end());
588 parameter_union.erase(std::unique(parameter_union.begin(), parameter_union.end()),
589 parameter_union.end());
591 std::vector<std::string> parameter_set_names;
592 std::map<std::string, bool> specified;
593 bool specified_a_set =
false;
594 for (
const auto & parameter_set : parameter_sets)
597 std::stringstream ss;
598 for (
unsigned int i = 0; i < parameter_set.size(); i++)
600 ss << parameter_set[i];
602 ss <<
"," << parameter_set[i];
603 const std::string parameter_set_name = ss.str();
604 parameter_set_names.push_back(parameter_set_name);
607 bool all_parameters_provided =
true;
608 for (
const auto & parameter : parameter_set)
609 if (!isParamValid(parameter))
610 all_parameters_provided =
false;
612 if (all_parameters_provided)
615 if (!specified_a_set)
617 specified[parameter_set_name] =
true;
620 std::vector<std::string> parameter_set_sorted(parameter_set);
621 std::sort(parameter_set_sorted.begin(), parameter_set_sorted.end());
622 std::vector<std::string> extraneous_parameters;
623 std::set_difference(parameter_union.begin(),
624 parameter_union.end(),
625 parameter_set_sorted.begin(),
626 parameter_set_sorted.end(),
627 std::inserter(extraneous_parameters, extraneous_parameters.end()));
628 for (
const auto & parameter : extraneous_parameters)
629 if (isParamValid(parameter))
633 ") has been specified; ",
635 " cannot be specified.");
638 specified_a_set =
true;
641 specified[parameter_set_name] =
false;
644 if (!specified_a_set && throw_error_if_no_match)
646 std::stringstream ss;
647 ss <<
name() <<
": For " << fp_type
648 <<
" fluid properties, you must provide one of the following\n"
649 "combinations of thermodynamic properties:\n";
650 for (
const auto & parameter_set_name : parameter_set_names)
651 ss <<
" * (" << parameter_set_name <<
")\n";
652 mooseError(ss.str());
Referenced by compute1Phase(), compute2Phase(), and computeVaporMixture().
◆ initialize()
void FluidPropertiesInterrogator::initialize |
( |
| ) |
|
|
overridevirtual |
◆ outputASCII1Phase()
void FluidPropertiesInterrogator::outputASCII1Phase |
( |
const std::string & |
description, |
|
|
const InputParameters & |
params |
|
) |
| |
|
protected |
Output 1-phase fluid properties in plain text format.
- Parameters
-
[in] | description | String describing the 1-phase fluid properties |
[in] | params | Input parameters with values to print |
Definition at line 531 of file FluidPropertiesInterrogator.C.
539 if (params.have_parameter<Real>(
"vel"))
Referenced by execute().
◆ outputASCII2Phase()
void FluidPropertiesInterrogator::outputASCII2Phase |
( |
const InputParameters & |
params | ) |
|
|
protected |
Output 2-phase fluid properties in plain text format.
- Parameters
-
[in] | params | Input parameters with values to print |
Definition at line 547 of file FluidPropertiesInterrogator.C.
550 outputProperty(
"Critical pressure", params.get<Real>(
"p_critical"),
"Pa");
551 if (params.have_parameter<Real>(
"T_sat"))
552 outputProperty(
"Saturation temperature", params.get<Real>(
"T_sat"),
"K");
553 if (params.have_parameter<Real>(
"p_sat"))
554 outputProperty(
"Saturation pressure", params.get<Real>(
"p_sat"),
"Pa");
555 if (params.have_parameter<Real>(
"h_lat"))
556 outputProperty(
"Latent heat of vaporization", params.get<Real>(
"h_lat"),
"J/kg");
557 if (params.have_parameter<Real>(
"sigma"))
558 outputProperty(
"Surface tension", params.get<Real>(
"sigma"),
"N/m");
559 _console << std::endl;
Referenced by execute().
◆ outputASCIIVaporMixture()
void FluidPropertiesInterrogator::outputASCIIVaporMixture |
( |
const InputParameters & |
params | ) |
|
|
protected |
Output vapor mixture fluid properties in plain text format.
- Parameters
-
[in] | params | Input parameters with values to print |
Definition at line 563 of file FluidPropertiesInterrogator.C.
570 if (params.have_parameter<Real>(
"vel"))
Referenced by execute().
◆ outputHeader()
void FluidPropertiesInterrogator::outputHeader |
( |
const std::string & |
header | ) |
const |
|
protected |
◆ outputProperty()
void FluidPropertiesInterrogator::outputProperty |
( |
const std::string & |
name, |
|
|
const Real & |
value, |
|
|
const std::string & |
units |
|
) |
| |
|
protected |
◆ outputStagnationProperties()
void FluidPropertiesInterrogator::outputStagnationProperties |
( |
const InputParameters & |
params | ) |
|
|
protected |
Outputs stagnation properties for a single-phase fluid properties object.
- Parameters
-
[in] | params | Input parameters with values to print |
Definition at line 719 of file FluidPropertiesInterrogator.C.
724 outputProperty(
"Specific volume", params.get<Real>(
"v0"),
"m^3/kg");
725 outputProperty(
"Specific internal energy", params.get<Real>(
"e0"),
"J/kg");
726 outputProperty(
"Specific enthalpy", params.get<Real>(
"h0"),
"J/kg");
727 outputProperty(
"Specific entropy", params.get<Real>(
"s0"),
"J/kg");
728 _console << std::endl;
730 outputProperty(
"Dynamic viscosity", params.get<Real>(
"mu0"),
"Pa-s");
731 outputProperty(
"Specific heat at constant pressure", params.get<Real>(
"cp0"),
"J/(kg-K)");
732 outputProperty(
"Specific heat at constant volume", params.get<Real>(
"cv0"),
"J/(kg-K)");
733 outputProperty(
"Thermal conductivity", params.get<Real>(
"k0"),
"W/(m-K)");
734 outputProperty(
"Volumetric expansion coefficient", params.get<Real>(
"beta0"),
"1/K");
735 _console << std::endl;
Referenced by outputASCII1Phase().
◆ outputStaticProperties()
void FluidPropertiesInterrogator::outputStaticProperties |
( |
const InputParameters & |
params | ) |
|
|
protected |
Outputs static properties for a single-phase fluid properties object.
- Parameters
-
[in] | params | Input parameters with values to print |
Definition at line 699 of file FluidPropertiesInterrogator.C.
704 outputProperty(
"Specific volume", params.get<Real>(
"v"),
"m^3/kg");
705 outputProperty(
"Specific internal energy", params.get<Real>(
"e"),
"J/kg");
706 outputProperty(
"Specific enthalpy", params.get<Real>(
"h"),
"J/kg");
707 outputProperty(
"Specific entropy", params.get<Real>(
"s"),
"J/kg");
708 _console << std::endl;
710 outputProperty(
"Dynamic viscosity", params.get<Real>(
"mu"),
"Pa-s");
711 outputProperty(
"Specific heat at constant pressure", params.get<Real>(
"cp"),
"J/(kg-K)");
712 outputProperty(
"Specific heat at constant volume", params.get<Real>(
"cv"),
"J/(kg-K)");
713 outputProperty(
"Thermal conductivity", params.get<Real>(
"k"),
"W/(m-K)");
714 outputProperty(
"Volumetric expansion coefficient", params.get<Real>(
"beta"),
"1/K");
715 _console << std::endl;
Referenced by outputASCII1Phase().
◆ outputVaporMixtureStagnationProperties()
void FluidPropertiesInterrogator::outputVaporMixtureStagnationProperties |
( |
const InputParameters & |
params | ) |
|
|
protected |
◆ outputVaporMixtureStaticProperties()
void FluidPropertiesInterrogator::outputVaporMixtureStaticProperties |
( |
const InputParameters & |
params | ) |
|
|
protected |
Outputs static properties for a vapor mixture fluid properties object.
- Parameters
-
[in] | params | Input parameters with values to print |
Definition at line 739 of file FluidPropertiesInterrogator.C.
744 outputProperty(
"Specific volume", params.get<Real>(
"v"),
"m^3/kg");
745 outputProperty(
"Specific internal energy", params.get<Real>(
"e"),
"J/kg");
746 outputProperty(
"Specific enthalpy", params.get<Real>(
"h"),
"J/kg");
747 _console << std::endl;
749 outputProperty(
"Dynamic viscosity", params.get<Real>(
"mu"),
"Pa-s");
750 outputProperty(
"Specific heat at constant pressure", params.get<Real>(
"cp"),
"J/(kg-K)");
751 outputProperty(
"Specific heat at constant volume", params.get<Real>(
"cv"),
"J/(kg-K)");
752 outputProperty(
"Thermal conductivity", params.get<Real>(
"k"),
"W/(m-K)");
753 _console << std::endl;
Referenced by outputASCIIVaporMixture().
◆ _fp
◆ _fp_1phase
◆ _fp_2phase
◆ _fp_2phase_ncg
◆ _fp_liquid
◆ _fp_vapor
◆ _fp_vapor_mixture
◆ _has_1phase
const bool FluidPropertiesInterrogator::_has_1phase |
|
protected |
◆ _has_2phase
const bool FluidPropertiesInterrogator::_has_2phase |
|
protected |
◆ _has_2phase_ncg
const bool FluidPropertiesInterrogator::_has_2phase_ncg |
|
protected |
◆ _has_vapor_mixture
const bool FluidPropertiesInterrogator::_has_vapor_mixture |
|
protected |
◆ _json
const bool& FluidPropertiesInterrogator::_json |
|
protected |
◆ _nan_encountered
bool FluidPropertiesInterrogator::_nan_encountered |
|
protected |
◆ _precision
const unsigned int& FluidPropertiesInterrogator::_precision |
|
protected |
The documentation for this class was generated from the following files:
virtual const UserObjectName & getVaporName() const
Returns the name of the vapor single-phase fluid properties object.
void outputHeader(const std::string &header) const
Outputs a header for a section of properties.
void outputASCII1Phase(const std::string &description, const InputParameters ¶ms)
Output 1-phase fluid properties in plain text format.
void outputVaporMixtureStaticProperties(const InputParameters ¶ms)
Outputs static properties for a vapor mixture fluid properties object.
virtual Real e_from_p_T(Real p, Real T, const std::vector< Real > &x) const =0
Specific internal energy from pressure and temperature.
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.
InputParameters compute1Phase(const SinglePhaseFluidProperties *const fp_1phase, bool throw_error_if_no_match)
Queries a 1-phase fluid properties object.
virtual Real sigma_from_T(Real T) const
Computes surface tension sigma of saturated liquid in contact with saturated vapor.
virtual Real k_from_p_T(Real p, Real T, const std::vector< Real > &x) const =0
Thermal conductivity from pressure and temperature.
virtual const UserObjectName & getLiquidName() const
Returns the name of the liquid single-phase fluid properties object.
void outputVaporMixtureStagnationProperties(const InputParameters ¶ms)
Outputs stagnation properties for a vapor mixture fluid properties object.
virtual Real c_from_p_T(Real p, Real T, const std::vector< Real > &x) const =0
Sound speed from pressure and temperature.
const VaporMixtureFluidProperties *const _fp_vapor_mixture
pointer to vapor mixture fluid properties object (if provided 2-phase NCG object)
virtual Real p_from_v_e(Real v, Real e, const std::vector< Real > &x) const =0
Pressure from specific volume and specific internal energy.
const SinglePhaseFluidProperties *const _fp_1phase
pointer to 1-phase fluid properties object (if provided 1-phase object)
virtual Real cv_from_p_T(Real p, Real T, const std::vector< Real > &x) const =0
Isochoric (constant-volume) specific heat from pressure and temperature.
void buildJSON1Phase(moosecontrib::Json::Value &json, const InputParameters ¶ms)
Build 1-phase fluid properties in JSON format.
virtual Real h_lat(Real p, Real T) const
Computes latent heat of vaporization.
void buildJSON2Phase(moosecontrib::Json::Value &json, const InputParameters ¶ms)
Build 2-phase fluid properties in JSON format.
virtual Real p_critical() const =0
Returns the critical pressure.
const UserObjectName & getVaporMixtureName() const
Returns the name of the vapor mixture fluid properties object.
const SinglePhaseFluidProperties *const _fp_liquid
pointer to liquid fluid properties object (if provided 2-phase object)
virtual Real rho_from_p_T(Real p, Real T, const std::vector< Real > &x) const =0
Density from pressure and temperature.
virtual Real T_from_v_e(Real v, Real e, const std::vector< Real > &x) const =0
Temperature from specific volume and specific internal energy.
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)
const bool _has_vapor_mixture
flag that user provided vapor mixture fluid properties
const bool _has_2phase
flag that user provided 2-phase fluid properties
void outputASCIIVaporMixture(const InputParameters ¶ms)
Output vapor mixture fluid properties in plain text format.
virtual Real cp_from_p_T(Real p, Real T, const std::vector< Real > &x) const =0
Isobaric (constant-pressure) specific heat from pressure and temperature.
const TwoPhaseFluidProperties *const _fp_2phase
pointer to 2-phase fluid properties object (if provided 2-phase object)
std::map< std::string, bool > getSpecifiedSetMap(const std::vector< std::vector< std::string >> ¶meter_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 outputASCII2Phase(const InputParameters ¶ms)
Output 2-phase fluid properties in plain text format.
virtual Real p_sat(Real T) const =0
Computes the saturation pressure at a temperature.
InputParameters compute2Phase()
Queries a 2-phase fluid properties object.
virtual Real T_sat(Real p) const =0
Computes the saturation temperature at a pressure.
void buildJSONVaporMixture(moosecontrib::Json::Value &json, const InputParameters ¶ms)
Build vapor mixture fluid properties in JSON format.
const bool & _json
true if the output should use JSON format
const FluidProperties *const _fp
pointer to fluid properties object
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)
void outputStagnationProperties(const InputParameters ¶ms)
Outputs stagnation properties for a single-phase fluid properties object.
virtual Real mu_from_p_T(Real p, Real T, const std::vector< Real > &x) const =0
Dynamic viscosity from pressure and temperature.
void outputStaticProperties(const InputParameters ¶ms)
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.