Skip to content

Commit

Permalink
Merge pull request #13031 from joshuahansel/hansje/fp-interrogator
Browse files Browse the repository at this point in the history
Added fluid properties interrogator
  • Loading branch information
andrsd committed Mar 11, 2019
2 parents 6984549 + a7f7a67 commit 52d2630
Show file tree
Hide file tree
Showing 27 changed files with 1,911 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions modules/fluid_properties/fp_interrogator/fp_interrogator.i
Original file line number Diff line number Diff line change
@@ -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
[../]
[../]
[]
Original file line number Diff line number Diff line change
@@ -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 */
Loading

0 comments on commit 52d2630

Please sign in to comment.