LCOV - code coverage report
Current view: top level - src/kernels - PorousFlowAdvectiveFlux.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 29 29 100.0 %
Date: 2017-11-21 14:47:27 Functions: 6 6 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /****************************************************************/
       2             : /* MOOSE - Multiphysics Object Oriented Simulation Environment  */
       3             : /*                                                              */
       4             : /*          All contents are licensed under LGPL V2.1           */
       5             : /*             See LICENSE for full restrictions                */
       6             : /****************************************************************/
       7             : 
       8             : #include "PorousFlowAdvectiveFlux.h"
       9             : 
      10             : template <>
      11             : InputParameters
      12         120 : validParams<PorousFlowAdvectiveFlux>()
      13             : {
      14         120 :   InputParameters params = validParams<PorousFlowDarcyBase>();
      15         360 :   params.addParam<unsigned int>(
      16         120 :       "fluid_component", 0, "The index corresponding to the fluid component for this kernel");
      17         240 :   params.addClassDescription(
      18         120 :       "Fully-upwinded advective flux of the component given by fluid_component");
      19         120 :   return params;
      20             : }
      21             : 
      22         121 : PorousFlowAdvectiveFlux::PorousFlowAdvectiveFlux(const InputParameters & parameters)
      23             :   : PorousFlowDarcyBase(parameters),
      24             :     _mass_fractions(
      25         242 :         getMaterialProperty<std::vector<std::vector<Real>>>("PorousFlow_mass_frac_nodal")),
      26             :     _dmass_fractions_dvar(getMaterialProperty<std::vector<std::vector<std::vector<Real>>>>(
      27         242 :         "dPorousFlow_mass_frac_nodal_dvar")),
      28             :     _relative_permeability(
      29         242 :         getMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal")),
      30             :     _drelative_permeability_dvar(getMaterialProperty<std::vector<std::vector<Real>>>(
      31         242 :         "dPorousFlow_relative_permeability_nodal_dvar")),
      32         968 :     _fluid_component(getParam<unsigned int>("fluid_component"))
      33             : {
      34         121 : }
      35             : 
      36             : Real
      37     2644884 : PorousFlowAdvectiveFlux::mobility(unsigned nodenum, unsigned phase) const
      38             : {
      39    10579536 :   return _mass_fractions[nodenum][phase][_fluid_component] * _fluid_density_node[nodenum][phase] *
      40     7934652 :          _relative_permeability[nodenum][phase] / _fluid_viscosity[nodenum][phase];
      41             : }
      42             : 
      43             : Real
      44     1149153 : PorousFlowAdvectiveFlux::dmobility(unsigned nodenum, unsigned phase, unsigned pvar) const
      45             : {
      46     3447459 :   Real dm = _dmass_fractions_dvar[nodenum][phase][_fluid_component][pvar] *
      47     4596612 :             _fluid_density_node[nodenum][phase] * _relative_permeability[nodenum][phase] /
      48     2298306 :             _fluid_viscosity[nodenum][phase];
      49     4596612 :   dm += _mass_fractions[nodenum][phase][_fluid_component] *
      50     2298306 :         _dfluid_density_node_dvar[nodenum][phase][pvar] * _relative_permeability[nodenum][phase] /
      51             :         _fluid_viscosity[nodenum][phase];
      52     3447459 :   dm += _mass_fractions[nodenum][phase][_fluid_component] * _fluid_density_node[nodenum][phase] *
      53     2298306 :         _drelative_permeability_dvar[nodenum][phase][pvar] / _fluid_viscosity[nodenum][phase];
      54     2298306 :   dm -= _mass_fractions[nodenum][phase][_fluid_component] * _fluid_density_node[nodenum][phase] *
      55     3447459 :         _relative_permeability[nodenum][phase] * _dfluid_viscosity_dvar[nodenum][phase][pvar] /
      56             :         std::pow(_fluid_viscosity[nodenum][phase], 2);
      57     1149153 :   return dm;
      58        2499 : }

Generated by: LCOV version 1.11