Skip to content
Permalink
Browse files

Merge pull request #13031 from joshuahansel/hansje/fp-interrogator

Added fluid properties interrogator
  • Loading branch information...
andrsd committed Mar 11, 2019
2 parents 6984549 + a7f7a67 commit 52d2630338f4316c2c92420449b7697f9cf57aa0
Showing with 1,911 additions and 0 deletions.
  1. +7 −0 modules/fluid_properties/doc/content/modules/fluid_properties/index.md
  2. +11 −0 modules/fluid_properties/doc/content/source/actions/AddFluidPropertiesInterrogatorAction.md
  3. +115 −0 modules/fluid_properties/doc/content/source/userobjects/FluidPropertiesInterrogator.md
  4. +10 −0 modules/fluid_properties/doc/content/syntax/FluidPropertiesInterrogator/index.md
  5. +17 −0 modules/fluid_properties/fp_interrogator/fp_interrogator.i
  6. +37 −0 modules/fluid_properties/include/actions/AddFluidPropertiesInterrogatorAction.h
  7. +197 −0 modules/fluid_properties/include/userobjects/FluidPropertiesInterrogator.h
  8. +2 −0 modules/fluid_properties/include/userobjects/TwoPhaseNCGFluidProperties.h
  9. +158 −0 modules/fluid_properties/src/actions/AddFluidPropertiesInterrogatorAction.C
  10. +3 −0 modules/fluid_properties/src/base/FluidPropertiesApp.C
  11. +583 −0 modules/fluid_properties/src/userobjects/FluidPropertiesInterrogator.C
  12. +37 −0 modules/fluid_properties/test/include/userobjects/TestTwoPhaseFluidProperties.h
  13. +31 −0 modules/fluid_properties/test/include/userobjects/TestTwoPhaseNCGFluidProperties.h
  14. +60 −0 modules/fluid_properties/test/src/userobjects/TestTwoPhaseFluidProperties.C
  15. +72 −0 modules/fluid_properties/test/src/userobjects/TestTwoPhaseNCGFluidProperties.C
  16. +17 −0 modules/fluid_properties/test/tests/fp_interrogator/1ph.p_T.i
  17. +17 −0 modules/fluid_properties/test/tests/fp_interrogator/1ph.rho_e.i
  18. +17 −0 modules/fluid_properties/test/tests/fp_interrogator/1ph.rho_p.i
  19. +16 −0 modules/fluid_properties/test/tests/fp_interrogator/1ph.rho_rhou_rhoE.i
  20. +28 −0 modules/fluid_properties/test/tests/fp_interrogator/2ph.T.i
  21. +28 −0 modules/fluid_properties/test/tests/fp_interrogator/2ph.p.i
  22. +29 −0 modules/fluid_properties/test/tests/fp_interrogator/2ph.p_T.i
  23. +20 −0 modules/fluid_properties/test/tests/fp_interrogator/2ph_ncg_p_T.i
  24. +15 −0 modules/fluid_properties/test/tests/fp_interrogator/err.no_params.i
  25. +14 −0 modules/fluid_properties/test/tests/fp_interrogator/err.wrong_fp_type.i
  26. +344 −0 modules/fluid_properties/test/tests/fp_interrogator/tests
  27. +26 −0 modules/fluid_properties/test/tests/fp_interrogator/vapor_mixture_rho_e.i
@@ -158,6 +158,13 @@ New fluids can be added to the Fluid Properties module by inheriting from the ba
overriding the methods that describe the fluid properties. These can then be used in an
identical manner as all other Fluid Properties UserObjects.

## Utilities

### Fluid Properties Interrogator

The [FluidPropertiesInterrogator](/FluidPropertiesInterrogator.md) is a user
object which can be used to query eligible fluid properties objects.

## Additional objects

Several additional objects such as AuxKernels and Materials are provided:
@@ -0,0 +1,11 @@
# AddFluidPropertiesInterrogatorAction

!syntax description /FluidPropertiesInterrogator/AddFluidPropertiesInterrogatorAction

This action performs a number of tasks needed to use [FluidPropertiesInterrogator](/FluidPropertiesInterrogator.md)
in a minimal setting; it creates a dummy mesh, executioner, and problem, and it
creates a console output for the printing performed by the interrogator.

!syntax parameters /FluidPropertiesInterrogator/AddFluidPropertiesInterrogatorAction

!bibtex bibliography
@@ -0,0 +1,115 @@
# FluidPropertiesInterrogator

!syntax description /UserObjects/FluidPropertiesInterrogator

## Introduction

The `FluidPropertiesInterrogator` user object is used to query fluid properties
objects that derive from the following types:

- `SinglePhaseFluidProperties`
- `VaporMixtureFluidProperties`
- `TwoPhaseFluidProperties` (note that `TwoPhaseNCGFluidProperties` derives from this)

The user specifies a thermodynamic state at which to evaluate a number of fluid
properties. This can be useful for a number of different tasks, such as the
following:

- Determining values for initial conditions or problem setup
- Verifying out-of-bounds inputs to fluid properties interfaces
- Getting values to be used in tests

## Usage

The interrogator is used with a syntax for
[AddFluidPropertiesInterrogatorAction](/AddFluidPropertiesInterrogatorAction.md).
In an input file, the user will only need a block for the `FluidPropertiesInterrogator`
and a block for creating the fluid properties object that will be interrogated.
For convenience, an input file to use the interrogator is provided in the module:

!listing fluid_properties/fp_interrogator/fp_interrogator.i

## Valid Input Combinations

Notation is summarized in the following table:

| Symbol | Description |
| - | - |
| $p$ | Pressure |
| $p_{sat}$ | Saturation pressure |
| $p_{crit}$ | Critical pressure |
| $T$ | Temperature |
| $T_{sat}$ | Saturation temperature |
| $\rho$ | Density |
| $v$ | Specific volume |
| $e$ | Specific internal energy |
| $E$ | Specific total energy |
| $h$ | Specific enthalpy |
| $\Delta h_{\ell\rightarrow v}$ | Latent heat of vaporization |
| $s$ | Specific entropy |
| $c$ | Sound speed |
| $u$ | Fluid speed |
| $\mu$ | Dynamic viscosity |
| $c_p$ | Specific heat at constant pressure |
| $c_v$ | Specific heat at constant volume |
| $k$ | Thermal conductivity |
| $\beta$ | Volumetric expansion coefficient |
| $x_{NCG}$ | Mass fraction of non-condensable gas |

Let the set of single-phase fluid properties be defined as
\begin{equation}
\mathcal{P} \equiv \{p, T, \rho, v, e, h, s, c, \mu, c_p, c_v, k, \beta\} \,.
\end{equation}
The set of the same quantities for the *stagnation* state, rather than the
static state, is denoted as $\mathcal{P}_0$.

Let the set of valid inputs for single-phase *static* fluid properties be
\begin{equation}
\mathcal{A} \equiv \{ \{p, T\}, \{p, \rho\}, \{\rho, e\} \} \,,
\end{equation}
and the set of valid inputs for single-phase *stagnation* fluid properties be
\begin{equation}
\mathcal{A}_0 \equiv \{ \{p, T, u\}, \{p, \rho, u\}, \{\rho, e, u\}, \{\rho, \rho u, \rho E\} \} \,.
\end{equation}
For single-phase vapor mixture fluid properties, the valid input sets are as follows:
\begin{equation}
\mathcal{A}_{mix} \equiv \{ \{p, T, x_{NCG}\}, \{\rho, e, x_{NCG}\} \} \,,
\end{equation}
\begin{equation}
\mathcal{A}_{0,mix} \equiv \{ \{p, T, x_{NCG}, u\}, \{\rho, e, x_{NCG}, u\}, \{\rho, \rho u, \rho E, x_{NCG}\} \} \,,
\end{equation}


The following table summarizes the valid input combinations for single-phase
fluid properties objects.
Note that
`TwoPhaseNCGFluidProperties` inherits from `TwoPhaseFluidProperties`, so the
column `TwoPhaseFluidProperties` is used to describe fluid properties classes
that derive from `TwoPhaseFluidProperties` but not `TwoPhaseNCGFluidProperties`.

| Base Class | Valid Input Combinations | Outputs |
| - | - | - |
| `SinglePhaseFluidProperties` | $\mathcal{I}\in\mathcal{A}$ | $\mathcal{P}$ |
| | $\mathcal{I}\in\mathcal{A}_0$ | $\mathcal{P}$, $\mathcal{P}_0$ |
| `VaporMixtureFluidProperties` | $\mathcal{I}\in\mathcal{A}_{mix}$ | $\mathcal{P}$ |
| | $\mathcal{I}\in\mathcal{A}_{0,mix}$ | $\mathcal{P}$, $\mathcal{P}_0$ |
| `TwoPhaseFluidProperties` | $\mathcal{I} = \{\}$ | $p_{crit}$ |
| | $\mathcal{I}\in\{p\}$ | $p_{crit}$, $T_{sat}$, $\Delta h_{\ell\rightarrow v}$ |
| | $\mathcal{I}\in\{T\}$ | $p_{crit}$, $p_{sat}$, $\Delta h_{\ell\rightarrow v}$ |
| | $\mathcal{I}\in\{p, T\}$ | $p_{crit}$, $\Delta h_{\ell\rightarrow v}$ |
| | $\mathcal{I}\in\mathcal{A}, \mathcal{I}\ne\{p, T\}$ | $p_{crit}$, $\mathcal{P}_\ell$, $\mathcal{P}_v$ |
| | $\mathcal{I}\in\mathcal{A}_0$ | $p_{crit}$, $\mathcal{P}_\ell$, $\mathcal{P}_v$, $\mathcal{P}_{0,\ell}$, $\mathcal{P}_{0,v}$ |
| `TwoPhaseNCGFluidProperties` | $\mathcal{I} = \{\}$ | $p_{crit}$ |
| | $\mathcal{I}\in\{p\}$ | $p_{crit}$, $T_{sat}$, $\Delta h_{\ell\rightarrow v}$ |
| | $\mathcal{I}\in\{T\}$ | $p_{crit}$, $p_{sat}$, $\Delta h_{\ell\rightarrow v}$ |
| | $\mathcal{I}\in\{p, T\}$ | $p_{crit}$, $\Delta h_{\ell\rightarrow v}$ |
| | $\mathcal{I}\in\mathcal{A}, \quad \mathcal{I}\ne\{p, T\}$ | $p_{crit}$, $\mathcal{P}_\ell$ |
| | $\mathcal{I}\in\mathcal{A}_0$ | $p_{crit}$, $\mathcal{P}_\ell$, $\mathcal{P}_{0,\ell}$ |
| | $\mathcal{I}\in\mathcal{A}_{mix}$ | $p_{crit}$, $\mathcal{P}_\ell$, $\mathcal{P}_v$ |
| | $\mathcal{I}\in\mathcal{A}_{0,mix}$ | $p_{crit}$, $\mathcal{P}_\ell$, $\mathcal{P}_v$, $\mathcal{P}_{0,\ell}$, $\mathcal{P}_{0,v}$ |

!syntax parameters /UserObjects/FluidPropertiesInterrogator

!syntax inputs /UserObjects/FluidPropertiesInterrogator

!syntax children /UserObjects/FluidPropertiesInterrogator
@@ -0,0 +1,10 @@
# FluidPropertiesInterrogator System

The `FluidPropertiesInterrogator` syntax is used with
[AddFluidPropertiesInterrogatorAction](/AddFluidPropertiesInterrogatorAction.md).

!syntax list /FluidPropertiesInterrogator objects=True actions=False subsystems=False

!syntax list /FluidPropertiesInterrogator objects=False actions=False subsystems=True

!syntax list /FluidPropertiesInterrogator objects=False actions=True subsystems=False
@@ -0,0 +1,17 @@
# The parameters in this block are used to specify the thermodynamic state
# at which to query the fluid properties package
[FluidPropertiesInterrogator]
fp = fp
p = 1e5
T = 300
vel = 10
[]

# The fluid properties (equation of state) to query is defined here
[Modules]
[./FluidProperties]
[./fp]
type = IdealGasFluidProperties
[../]
[../]
[]
@@ -0,0 +1,37 @@
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#ifndef ADDFLUIDPROPERTIESINTERROGATORACTION_H
#define ADDFLUIDPROPERTIESINTERROGATORACTION_H

#include "Action.h"

class AddFluidPropertiesInterrogatorAction;

template <>
InputParameters validParams<AddFluidPropertiesInterrogatorAction>();

/**
* Action that sets up the fluid properties interrogator
*/
class AddFluidPropertiesInterrogatorAction : public Action
{
public:
AddFluidPropertiesInterrogatorAction(InputParameters parameters);

virtual void act() override;

protected:
/**
* Adds the FluidPropertiesInterrogator user object
*/
void addFluidPropertiesInterrogatorObject() const;
};

#endif /* ADDFLUIDPROPERTIESINTERROGATORACTION_H */
Oops, something went wrong.

0 comments on commit 52d2630

Please sign in to comment.
You can’t perform that action at this time.