LCOV - code coverage report
Current view: top level - src/fluidproperties - TwoPhaseFluidPropertiesIndependent.C (source / functions) Hit Total Coverage
Test: idaholab/moose fluid_properties: #31405 (292dce) with base fef103 Lines: 20 41 48.8 %
Date: 2025-09-04 07:53:14 Functions: 4 14 28.6 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : #include "TwoPhaseFluidPropertiesIndependent.h"
      11             : #include "SinglePhaseFluidProperties.h"
      12             : 
      13             : registerMooseObject("FluidPropertiesApp", TwoPhaseFluidPropertiesIndependent);
      14             : 
      15             : InputParameters
      16          87 : TwoPhaseFluidPropertiesIndependent::validParams()
      17             : {
      18          87 :   InputParameters params = TwoPhaseFluidProperties::validParams();
      19             : 
      20          87 :   params.addClassDescription(
      21             :       "2-phase fluid properties for 2 independent single-phase fluid properties");
      22             : 
      23          87 :   params.makeParamRequired<UserObjectName>("fp_liquid");
      24          87 :   params.makeParamRequired<UserObjectName>("fp_vapor");
      25         174 :   params.addParam<bool>(
      26             :       "error_on_unimplemented",
      27         174 :       true,
      28             :       "If true, throw an error when a 2-phase interface is called. Else, return a zero value.");
      29             : 
      30          87 :   return params;
      31           0 : }
      32             : 
      33          47 : TwoPhaseFluidPropertiesIndependent::TwoPhaseFluidPropertiesIndependent(
      34          47 :     const InputParameters & parameters)
      35             :   : TwoPhaseFluidProperties(parameters),
      36             : 
      37          94 :     _error_on_unimplemented(getParam<bool>("error_on_unimplemented"))
      38             : {
      39          47 :   _fp_liquid = &getUserObject<SinglePhaseFluidProperties>("fp_liquid");
      40          47 :   _fp_vapor = &getUserObject<SinglePhaseFluidProperties>("fp_vapor");
      41          47 : }
      42             : 
      43             : Real
      44          21 : TwoPhaseFluidPropertiesIndependent::getTwoPhaseInterfaceDummyValue() const
      45             : {
      46          21 :   if (_error_on_unimplemented)
      47           3 :     mooseError(
      48             :         "The 2-phase fluid properties class 'TwoPhaseFluidPropertiesIndependent' does not allow "
      49             :         "calling any 2-phase property interfaces.");
      50             :   else
      51          18 :     return 0;
      52             : }
      53             : 
      54             : Real
      55           0 : TwoPhaseFluidPropertiesIndependent::p_critical() const
      56             : {
      57           0 :   return getTwoPhaseInterfaceDummyValue();
      58             : }
      59             : 
      60             : Real
      61           0 : TwoPhaseFluidPropertiesIndependent::T_triple() const
      62             : {
      63           0 :   return getTwoPhaseInterfaceDummyValue();
      64             : }
      65             : 
      66          21 : Real TwoPhaseFluidPropertiesIndependent::T_sat(Real) const
      67             : {
      68          21 :   return getTwoPhaseInterfaceDummyValue();
      69             : }
      70             : 
      71             : ADReal
      72           0 : TwoPhaseFluidPropertiesIndependent::T_sat(const ADReal &) const
      73             : {
      74           0 :   return getTwoPhaseInterfaceDummyValue();
      75             : }
      76             : 
      77           0 : Real TwoPhaseFluidPropertiesIndependent::p_sat(Real) const
      78             : {
      79           0 :   return getTwoPhaseInterfaceDummyValue();
      80             : }
      81             : 
      82             : ADReal
      83           0 : TwoPhaseFluidPropertiesIndependent::p_sat(const ADReal &) const
      84             : {
      85           0 :   return getTwoPhaseInterfaceDummyValue();
      86             : }
      87             : 
      88           0 : Real TwoPhaseFluidPropertiesIndependent::dT_sat_dp(Real) const
      89             : {
      90           0 :   return getTwoPhaseInterfaceDummyValue();
      91             : }
      92             : 
      93             : Real
      94           0 : TwoPhaseFluidPropertiesIndependent::L_fusion() const
      95             : {
      96           0 :   return getTwoPhaseInterfaceDummyValue();
      97             : }
      98             : 
      99           0 : Real TwoPhaseFluidPropertiesIndependent::sigma_from_T(Real) const
     100             : {
     101           0 :   return getTwoPhaseInterfaceDummyValue();
     102             : }
     103             : 
     104             : ADReal
     105           0 : TwoPhaseFluidPropertiesIndependent::sigma_from_T(const ADReal &) const
     106             : {
     107           0 :   return getTwoPhaseInterfaceDummyValue();
     108             : }
     109             : 
     110           0 : Real TwoPhaseFluidPropertiesIndependent::dsigma_dT_from_T(Real) const
     111             : {
     112           0 :   return getTwoPhaseInterfaceDummyValue();
     113             : }

Generated by: LCOV version 1.14