LCOV - code coverage report
Current view: top level - src/tensor_computes - LBMComputeChemicalPotential.C (source / functions) Hit Total Coverage
Test: idaholab/swift: #92 (25e020) with base b3cd84 Lines: 0 20 0.0 %
Date: 2025-09-10 17:10:32 Functions: 0 3 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /**********************************************************************/
       2             : /*                    DO NOT MODIFY THIS HEADER                       */
       3             : /*             Swift, a Fourier spectral solver for MOOSE             */
       4             : /*                                                                    */
       5             : /*            Copyright 2024 Battelle Energy Alliance, LLC            */
       6             : /*                        ALL RIGHTS RESERVED                         */
       7             : /**********************************************************************/
       8             : 
       9             : #include "LBMComputeChemicalPotential.h"
      10             : 
      11             : registerMooseObject("SwiftApp", LBMComputeChemicalPotential);
      12             : 
      13             : InputParameters
      14           0 : LBMComputeChemicalPotential::validParams()
      15             : {
      16           0 :   InputParameters params = LatticeBoltzmannOperator::validParams();
      17           0 :   params.addClassDescription("Compute LB checmial potential for pahse field coupling.");
      18           0 :   params.addRequiredParam<TensorInputBufferName>("phi", "Phase field order parameter");
      19           0 :   params.addRequiredParam<TensorInputBufferName>("laplacian_phi",
      20             :                                                  "Laplacian of phase field order parameter");
      21           0 :   params.addRequiredParam<std::string>("thickness", "Interface thickness");
      22           0 :   params.addRequiredParam<std::string>("sigma", "Interfacial tension coefficient");
      23           0 :   return params;
      24           0 : }
      25             : 
      26           0 : LBMComputeChemicalPotential::LBMComputeChemicalPotential(const InputParameters & parameters)
      27             :   : LatticeBoltzmannOperator(parameters),
      28           0 :     _phi(getInputBuffer("phi")),
      29           0 :     _laplacian_phi(getInputBuffer("laplacian_phi")),
      30           0 :     _D(_lb_problem.getConstant<Real>(getParam<std::string>("thickness"))),
      31           0 :     _sigma(_lb_problem.getConstant<Real>(getParam<std::string>("sigma")))
      32             : {
      33           0 : }
      34             : 
      35             : void
      36           0 : LBMComputeChemicalPotential::computeBuffer()
      37             : {
      38           0 :   const auto part_1 = _sigma / _D * _phi * (_phi - 1.0);
      39           0 :   const auto part_2 = _D * _sigma * _laplacian_phi;
      40             : 
      41           0 :   _u = part_1.unsqueeze(-1) - part_2;
      42           0 : }

Generated by: LCOV version 1.14