LCOV - code coverage report
Current view: top level - src/auxkernels - SpecificVolumeAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 0 15 0.0 %
Date: 2025-08-14 10:14:56 Functions: 0 3 0.0 %
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 "SpecificVolumeAux.h"
      11             : 
      12             : registerMooseObject("NavierStokesApp", SpecificVolumeAux);
      13             : 
      14             : InputParameters
      15           0 : SpecificVolumeAux::validParams()
      16             : {
      17           0 :   InputParameters params = AuxKernel::validParams();
      18           0 :   params.addRequiredCoupledVar("rho", "Density of the phase");
      19           0 :   params.addCoupledVar("area", 1., "Cross-sectional area (if used)");
      20           0 :   params.addCoupledVar("alpha", 1., "Volume fraction (if used)");
      21           0 :   params.addClassDescription("This auxkernel computes the specific volume $v$ of the fluid.");
      22             : 
      23           0 :   return params;
      24           0 : }
      25             : 
      26           0 : SpecificVolumeAux::SpecificVolumeAux(const InputParameters & parameters)
      27             :   : AuxKernel(parameters),
      28           0 :     _rho(coupledValue("rho")),
      29           0 :     _area(coupledValue("area")),
      30           0 :     _alpha(coupledValue("alpha"))
      31             : {
      32           0 : }
      33             : 
      34             : Real
      35           0 : SpecificVolumeAux::computeValue()
      36             : {
      37             :   mooseAssert(_rho[_qp] != 0, "Detected zero density.");
      38           0 :   return _alpha[_qp] * _area[_qp] / _rho[_qp];
      39             : }

Generated by: LCOV version 1.14