LCOV - code coverage report
Current view: top level - src/auxkernels - WaveHeightAuxKernel.C (source / functions) Hit Total Coverage
Test: idaholab/moose fsi: #32971 (54bef8) with base c6cf66 Lines: 14 15 93.3 %
Date: 2026-05-29 20:36:35 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          19 : WaveHeightAuxKernel::validParams()
      16             : {
      17          19 :   InputParameters params = AuxKernel::validParams();
      18          19 :   params.addClassDescription("Calculates the wave heights given pressures.");
      19          38 :   params.addRequiredCoupledVar("pressure", "pressure variable");
      20          38 :   params.addRequiredParam<Real>("density", "fluid density");
      21          38 :   params.addRequiredParam<Real>("gravity", "acceleration due to gravity");
      22          19 :   return params;
      23           0 : }
      24             : 
      25          10 : WaveHeightAuxKernel::WaveHeightAuxKernel(const InputParameters & parameters)
      26             :   : AuxKernel(parameters),
      27          10 :     _pressure(coupledValue("pressure")),
      28          20 :     _density(getParam<Real>("density")),
      29          30 :     _gravity(getParam<Real>("gravity"))
      30             : {
      31          10 : }
      32             : 
      33             : Real
      34      123392 : WaveHeightAuxKernel::computeValue()
      35             : {
      36             :   // Vertical displacement = pressure/(density * gravity)
      37      123392 :   return _pressure[_qp] / (_density * _gravity);
      38             : }

Generated by: LCOV version 1.14