LCOV - code coverage report
Current view: top level - src/postprocessors - PFCElementEnergyIntegral.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #31405 (292dce) with base fef103 Lines: 16 17 94.1 %
Date: 2025-09-04 07:55:36 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 "PFCElementEnergyIntegral.h"
      11             : 
      12             : // MOOSE includes
      13             : #include "MooseVariable.h"
      14             : 
      15             : registerMooseObject("PhaseFieldApp", PFCElementEnergyIntegral);
      16             : 
      17             : InputParameters
      18          23 : PFCElementEnergyIntegral::validParams()
      19             : {
      20          23 :   InputParameters params = ElementIntegralPostprocessor::validParams();
      21          23 :   params.addClassDescription("Computes the integral of the energy from the temperature. Note that "
      22             :                              "the kb factor is missing.");
      23          46 :   params.addRequiredParam<VariableName>("variable",
      24             :                                         "The name of the variable that this object operates on");
      25          46 :   params.addParam<Real>("temp", 1833.0, "Temperature of simulation");
      26          23 :   return params;
      27           0 : }
      28             : 
      29          12 : PFCElementEnergyIntegral::PFCElementEnergyIntegral(const InputParameters & parameters)
      30             :   : ElementIntegralPostprocessor(parameters),
      31             :     MooseVariableInterface<Real>(this,
      32             :                                  false,
      33             :                                  "variable",
      34             :                                  Moose::VarKindType::VAR_ANY,
      35             :                                  Moose::VarFieldType::VAR_FIELD_STANDARD),
      36          12 :     _var(_subproblem.getStandardVariable(_tid, parameters.get<VariableName>("variable"))),
      37          12 :     _u(_var.sln()),
      38          12 :     _grad_u(_var.gradSln()),
      39          12 :     _u_dot(_var.uDot()),
      40          48 :     _temp(getParam<Real>("temp")) // K
      41             : {
      42             :   // TODO: error on unused parameters
      43          12 :   addMooseVariableDependency(&mooseVariableField());
      44          12 : }
      45             : 
      46             : Real
      47       11700 : PFCElementEnergyIntegral::computeQpIntegral()
      48             : {
      49             :   // const Real kb = 1.3806488e-23;  // A^2 kg s^-2 K^-1
      50             :   // const Real p0 = 0.0801; // A^-3
      51             : 
      52       11700 :   return _u[_qp]; // * (kb * _temp);
      53             : }

Generated by: LCOV version 1.14