LCOV - code coverage report
Current view: top level - src/auxkernels - WaveHeightAuxKernel.C (source / functions) Hit Total Coverage
Test: idaholab/moose fsi: #31405 (292dce) with base fef103 Lines: 14 15 93.3 %
Date: 2025-09-04 07:53:22 Functions: 3 3 100.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 "WaveHeightAuxKernel.h"
      11             : 
      12             : registerMooseObject("FsiApp", WaveHeightAuxKernel);
      13             : 
      14             : InputParameters
      15          41 : WaveHeightAuxKernel::validParams()
      16             : {
      17          41 :   InputParameters params = AuxKernel::validParams();
      18          41 :   params.addClassDescription("Calculates the wave heights given pressures.");
      19          82 :   params.addRequiredCoupledVar("pressure", "pressure variable");
      20          82 :   params.addRequiredParam<Real>("density", "fluid density");
      21          82 :   params.addRequiredParam<Real>("gravity", "acceleration due to gravity");
      22          41 :   return params;
      23           0 : }
      24             : 
      25          22 : WaveHeightAuxKernel::WaveHeightAuxKernel(const InputParameters & parameters)
      26             :   : AuxKernel(parameters),
      27          22 :     _pressure(coupledValue("pressure")),
      28          44 :     _density(getParam<Real>("density")),
      29          66 :     _gravity(getParam<Real>("gravity"))
      30             : {
      31          22 : }
      32             : 
      33             : Real
      34      184832 : WaveHeightAuxKernel::computeValue()
      35             : {
      36             :   // Vertical displacement = pressure/(density * gravity)
      37      184832 :   return _pressure[_qp] / (_density * _gravity);
      38             : }

Generated by: LCOV version 1.14