LCOV - code coverage report
Current view: top level - src/actions - PorousFlowActionBase.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 309 313 98.7 %
Date: 2017-11-20 10:17:24 Functions: 23 23 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             : #include "PorousFlowActionBase.h"
       8             : 
       9             : #include "FEProblem.h"
      10             : #include "MooseMesh.h"
      11             : #include "libmesh/string_to_enum.h"
      12             : #include "Conversion.h"
      13             : 
      14             : template <>
      15             : InputParameters
      16          73 : validParams<PorousFlowActionBase>()
      17             : {
      18          73 :   InputParameters params = validParams<Action>();
      19         219 :   params.addParam<std::string>(
      20             :       "dictator_name",
      21             :       "dictator",
      22          73 :       "The name of the dictator user object that is created by this Action");
      23         146 :   params.addClassDescription("Adds the PorousFlowDictator UserObject.  This class also contains "
      24             :                              "many utility functions for adding other pieces of an input file, "
      25          73 :                              "which may be used by derived classes.");
      26         292 :   params.addParam<RealVectorValue>("gravity",
      27          73 :                                    RealVectorValue(0.0, 0.0, -10.0),
      28          73 :                                    "Gravitational acceleration vector downwards (m/s^2)");
      29         219 :   params.addCoupledVar("temperature",
      30             :                        293.0,
      31             :                        "For isothermal simulations, this is the temperature "
      32             :                        "at which fluid properties (and stress-free strains) "
      33             :                        "are evaluated at.  Otherwise, this is the name of "
      34          73 :                        "the temperature variable.  Units = Kelvin");
      35         219 :   params.addCoupledVar("mass_fraction_vars",
      36             :                        "List of variables that represent the mass fractions.  Format is 'f_ph0^c0 "
      37             :                        "f_ph0^c1 f_ph0^c2 ... f_ph0^c(N-1) f_ph1^c0 f_ph1^c1 fph1^c2 ... "
      38             :                        "fph1^c(N-1) ... fphP^c0 f_phP^c1 fphP^c2 ... fphP^c(N-1)' where "
      39             :                        "N=num_components and P=num_phases, and it is assumed that "
      40             :                        "f_ph^cN=1-sum(f_ph^c,{c,0,N-1}) so that f_ph^cN need not be given.  If no "
      41          73 :                        "variables are provided then num_phases=1=num_components.");
      42         219 :   params.addParam<std::vector<NonlinearVariableName>>(
      43             :       "displacements",
      44             :       "The name of the displacement variables (relevant only for "
      45          73 :       "mechanically-coupled simulations)");
      46         219 :   params.addParam<std::string>("thermal_eigenstrain_name",
      47             :                                "thermal_eigenstrain",
      48             :                                "The eigenstrain_name used in the "
      49             :                                "ComputeThermalExpansionEigenstrain.  Only needed for "
      50          73 :                                "thermally-coupled simulations with thermal expansion.");
      51         219 :   params.addParam<bool>(
      52          73 :       "use_displaced_mesh", false, "Use displaced mesh computations in mechanical kernels");
      53          73 :   return params;
      54             : }
      55             : 
      56          73 : PorousFlowActionBase::PorousFlowActionBase(const InputParameters & params)
      57             :   : Action(params),
      58             :     PorousFlowDependencies(),
      59             :     _objects_to_add(),
      60             :     _dictator_name(getParam<std::string>("dictator_name")),
      61         146 :     _gravity(getParam<RealVectorValue>("gravity")),
      62         146 :     _mass_fraction_vars(getParam<std::vector<VariableName>>("mass_fraction_vars")),
      63          73 :     _num_mass_fraction_vars(_mass_fraction_vars.size()),
      64         146 :     _temperature_var(getParam<std::vector<VariableName>>("temperature")),
      65         146 :     _displacements(getParam<std::vector<NonlinearVariableName>>("displacements")),
      66          73 :     _ndisp(_displacements.size()),
      67         730 :     _coupled_displacements(_ndisp)
      68             : {
      69             :   // convert vector of NonlinearVariableName to vector of VariableName
      70         363 :   for (unsigned int i = 0; i < _ndisp; ++i)
      71         290 :     _coupled_displacements[i] = _displacements[i];
      72          73 : }
      73             : 
      74             : void
      75          70 : PorousFlowActionBase::act()
      76             : {
      77          70 :   const auto & all_subdomains = _problem->mesh().meshSubdomains();
      78          70 :   if (all_subdomains.empty())
      79           0 :     mooseError("No subdomains found");
      80          70 :   _coord_system = _problem->getCoordSystem(*all_subdomains.begin());
      81         140 :   for (const auto & subdomain : all_subdomains)
      82          70 :     if (_problem->getCoordSystem(subdomain) != _coord_system)
      83             :       mooseError(
      84           0 :           "The PorousFlow Actions require all subdomains to have the same coordinate system.");
      85             : 
      86         140 :   if (_current_task == "add_user_object")
      87          14 :     addDictator();
      88          70 : }
      89             : 
      90             : void
      91          20 : PorousFlowActionBase::addSaturationAux(unsigned phase)
      92             : {
      93          20 :   std::string phase_str = Moose::stringify(phase);
      94             : 
      95          40 :   if (_current_task == "add_aux_variable")
      96           8 :     _problem->addAuxVariable("saturation" + phase_str,
      97          16 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
      98           4 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
      99             : 
     100          40 :   if (_current_task == "add_aux_kernel")
     101             :   {
     102           4 :     std::string aux_kernel_type = "MaterialStdVectorAux";
     103           8 :     InputParameters params = _factory.getValidParams(aux_kernel_type);
     104             : 
     105           4 :     std::string aux_kernel_name = "PorousFlowActionBase_SaturationAux" + phase_str;
     106          12 :     params.set<MaterialPropertyName>("property") = "PorousFlow_saturation_qp";
     107           8 :     params.set<unsigned>("index") = phase;
     108          20 :     params.set<AuxVariableName>("variable") = "saturation" + phase_str;
     109          12 :     params.set<MultiMooseEnum>("execute_on") = "timestep_end";
     110           4 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     111             :   }
     112          20 : }
     113             : 
     114             : void
     115          65 : PorousFlowActionBase::addDarcyAux(const RealVectorValue & gravity)
     116             : {
     117         130 :   if (_current_task == "add_aux_variable")
     118             :   {
     119          26 :     _problem->addAuxVariable("darcy_vel_x",
     120          52 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     121          13 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     122          26 :     _problem->addAuxVariable("darcy_vel_y",
     123          52 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     124          13 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     125          26 :     _problem->addAuxVariable("darcy_vel_z",
     126          52 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     127          13 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     128             :   }
     129             : 
     130         130 :   if (_current_task == "add_aux_kernel")
     131             :   {
     132          13 :     std::string aux_kernel_type = "PorousFlowDarcyVelocityComponent";
     133          26 :     InputParameters params = _factory.getValidParams(aux_kernel_type);
     134             : 
     135          26 :     params.set<RealVectorValue>("gravity") = gravity;
     136          39 :     params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
     137          39 :     params.set<MultiMooseEnum>("execute_on") = "timestep_end";
     138             : 
     139          13 :     std::string aux_kernel_name = "PorousFlowActionBase_Darcy_x_Aux";
     140          39 :     params.set<MooseEnum>("component") = "x";
     141          39 :     params.set<AuxVariableName>("variable") = "darcy_vel_x";
     142          13 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     143             : 
     144             :     aux_kernel_name = "PorousFlowActionBase_Darcy_y_Aux";
     145          39 :     params.set<MooseEnum>("component") = "y";
     146          39 :     params.set<AuxVariableName>("variable") = "darcy_vel_y";
     147          13 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     148             : 
     149             :     aux_kernel_name = "PorousFlowActionBase_Darcy_z_Aux";
     150          39 :     params.set<MooseEnum>("component") = "z";
     151          39 :     params.set<AuxVariableName>("variable") = "darcy_vel_z";
     152          13 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     153             :   }
     154          65 : }
     155             : 
     156             : void
     157          50 : PorousFlowActionBase::addStressAux()
     158             : {
     159         100 :   if (_current_task == "add_aux_variable")
     160             :   {
     161          20 :     _problem->addAuxVariable("stress_xx",
     162          40 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     163          10 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     164          20 :     _problem->addAuxVariable("stress_xy",
     165          40 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     166          10 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     167          20 :     _problem->addAuxVariable("stress_xz",
     168          40 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     169          10 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     170          20 :     _problem->addAuxVariable("stress_yx",
     171          40 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     172          10 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     173          20 :     _problem->addAuxVariable("stress_yy",
     174          40 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     175          10 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     176          20 :     _problem->addAuxVariable("stress_yz",
     177          40 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     178          10 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     179          20 :     _problem->addAuxVariable("stress_zx",
     180          40 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     181          10 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     182          20 :     _problem->addAuxVariable("stress_zy",
     183          40 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     184          10 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     185          20 :     _problem->addAuxVariable("stress_zz",
     186          40 :                              FEType(Utility::string_to_enum<Order>("CONSTANT"),
     187          10 :                                     Utility::string_to_enum<FEFamily>("MONOMIAL")));
     188             :   }
     189             : 
     190         100 :   if (_current_task == "add_aux_kernel")
     191             :   {
     192          10 :     std::string aux_kernel_type = "RankTwoAux";
     193          20 :     InputParameters params = _factory.getValidParams(aux_kernel_type);
     194             : 
     195          30 :     params.set<MaterialPropertyName>("rank_two_tensor") = "stress";
     196          30 :     params.set<MultiMooseEnum>("execute_on") = "timestep_end";
     197             : 
     198          10 :     std::string aux_kernel_name = "PorousFlowAction_stress_xx";
     199          30 :     params.set<AuxVariableName>("variable") = "stress_xx";
     200          20 :     params.set<unsigned>("index_i") = 0;
     201          20 :     params.set<unsigned>("index_j") = 0;
     202          10 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     203             : 
     204             :     aux_kernel_name = "PorousFlowAction_stress_xy";
     205          30 :     params.set<AuxVariableName>("variable") = "stress_xy";
     206          20 :     params.set<unsigned>("index_i") = 0;
     207          20 :     params.set<unsigned>("index_j") = 1;
     208          10 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     209             : 
     210             :     aux_kernel_name = "PorousFlowAction_stress_xz";
     211          30 :     params.set<AuxVariableName>("variable") = "stress_xz";
     212          20 :     params.set<unsigned>("index_i") = 0;
     213          20 :     params.set<unsigned>("index_j") = 2;
     214          10 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     215             : 
     216             :     aux_kernel_name = "PorousFlowAction_stress_yx";
     217          30 :     params.set<AuxVariableName>("variable") = "stress_yx";
     218          20 :     params.set<unsigned>("index_i") = 1;
     219          20 :     params.set<unsigned>("index_j") = 0;
     220          10 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     221             : 
     222             :     aux_kernel_name = "PorousFlowAction_stress_yy";
     223          30 :     params.set<AuxVariableName>("variable") = "stress_yy";
     224          20 :     params.set<unsigned>("index_i") = 1;
     225          20 :     params.set<unsigned>("index_j") = 1;
     226          10 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     227             : 
     228             :     aux_kernel_name = "PorousFlowAction_stress_yz";
     229          30 :     params.set<AuxVariableName>("variable") = "stress_yz";
     230          20 :     params.set<unsigned>("index_i") = 1;
     231          20 :     params.set<unsigned>("index_j") = 2;
     232          10 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     233             : 
     234             :     aux_kernel_name = "PorousFlowAction_stress_zx";
     235          30 :     params.set<AuxVariableName>("variable") = "stress_zx";
     236          20 :     params.set<unsigned>("index_i") = 2;
     237          20 :     params.set<unsigned>("index_j") = 0;
     238          10 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     239             : 
     240             :     aux_kernel_name = "PorousFlowAction_stress_zy";
     241          30 :     params.set<AuxVariableName>("variable") = "stress_zy";
     242          20 :     params.set<unsigned>("index_i") = 2;
     243          20 :     params.set<unsigned>("index_j") = 1;
     244          10 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     245             : 
     246             :     aux_kernel_name = "PorousFlowAction_stress_zz";
     247          30 :     params.set<AuxVariableName>("variable") = "stress_zz";
     248          20 :     params.set<unsigned>("index_i") = 2;
     249          20 :     params.set<unsigned>("index_j") = 2;
     250          10 :     _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
     251             :   }
     252          50 : }
     253             : 
     254             : void
     255         110 : PorousFlowActionBase::addTemperatureMaterial(bool at_nodes)
     256             : {
     257         220 :   if (_current_task == "add_material")
     258             :   {
     259          66 :     if (!parameters().hasDefaultCoupledValue("temperature"))
     260             :       mooseError(
     261           0 :           "Attempt to add a PorousFlowTemperature material without setting a temperature variable");
     262             : 
     263          22 :     std::string material_type = "PorousFlowTemperature";
     264          44 :     InputParameters params = _factory.getValidParams(material_type);
     265             : 
     266          44 :     params.applySpecificParameters(parameters(), {"temperature"});
     267          66 :     params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
     268             : 
     269          22 :     std::string material_name = "PorousFlowActionBase_Temperature_qp";
     270          22 :     if (at_nodes)
     271             :       material_name = "PorousFlowActionBase_Temperature";
     272             : 
     273          44 :     params.set<bool>("at_nodes") = at_nodes;
     274          22 :     _problem->addMaterial(material_type, material_name, params);
     275             :   }
     276         110 : }
     277             : 
     278             : void
     279          55 : PorousFlowActionBase::addMassFractionMaterial(bool at_nodes)
     280             : {
     281         110 :   if (_current_task == "add_material")
     282             :   {
     283          44 :     if (!(parameters().hasDefaultCoupledValue("mass_fraction_vars") ||
     284          33 :           parameters().hasCoupledValue("mass_fraction_vars")))
     285             :       mooseError("Attempt to add a PorousFlowMassFraction material without setting the "
     286           0 :                  "mass_fraction_vars");
     287             : 
     288          11 :     std::string material_type = "PorousFlowMassFraction";
     289          22 :     InputParameters params = _factory.getValidParams(material_type);
     290             : 
     291          22 :     params.applySpecificParameters(parameters(), {"mass_fraction_vars"});
     292          33 :     params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
     293             : 
     294          11 :     std::string material_name = "PorousFlowActionBase_MassFraction_qp";
     295          11 :     if (at_nodes)
     296             :       material_name = "PorousFlowActionBase_MassFraction";
     297             : 
     298          22 :     params.set<bool>("at_nodes") = at_nodes;
     299          11 :     _problem->addMaterial(material_type, material_name, params);
     300             :   }
     301          55 : }
     302             : 
     303             : void
     304         105 : PorousFlowActionBase::addEffectiveFluidPressureMaterial(bool at_nodes)
     305             : {
     306         210 :   if (_current_task == "add_material")
     307             :   {
     308          21 :     std::string material_type = "PorousFlowEffectiveFluidPressure";
     309          42 :     InputParameters params = _factory.getValidParams(material_type);
     310             : 
     311          63 :     params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
     312             : 
     313          21 :     std::string material_name = "PorousFlowUnsaturated_EffectiveFluidPressure_qp";
     314          21 :     if (at_nodes)
     315             :       material_name = "PorousFlowUnsaturated_EffectiveFluidPressure";
     316             : 
     317          42 :     params.set<bool>("at_nodes") = at_nodes;
     318          21 :     _problem->addMaterial(material_type, material_name, params);
     319             :   }
     320         105 : }
     321             : 
     322             : void
     323          35 : PorousFlowActionBase::addVolumetricStrainMaterial(const std::vector<VariableName> & displacements,
     324             :                                                   bool consistent_with_displaced_mesh)
     325             : {
     326          70 :   if (_current_task == "add_material")
     327             :   {
     328           7 :     std::string material_type = "PorousFlowVolumetricStrain";
     329          14 :     InputParameters params = _factory.getValidParams(material_type);
     330             : 
     331           7 :     std::string material_name = "PorousFlowActionBase_VolumetricStrain";
     332          21 :     params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
     333          14 :     params.set<std::vector<VariableName>>("displacements") = displacements;
     334          14 :     params.set<bool>("consistent_with_displaced_mesh") = consistent_with_displaced_mesh;
     335           7 :     _problem->addMaterial(material_type, material_name, params);
     336             :   }
     337          35 : }
     338             : 
     339             : void
     340         100 : PorousFlowActionBase::addSingleComponentFluidMaterial(bool at_nodes,
     341             :                                                       unsigned phase,
     342             :                                                       bool compute_density_and_viscosity,
     343             :                                                       bool compute_internal_energy,
     344             :                                                       bool compute_enthalpy,
     345             :                                                       const UserObjectName & fp)
     346             : {
     347         200 :   if (_current_task == "add_material")
     348             :   {
     349          20 :     std::string material_type = "PorousFlowSingleComponentFluid";
     350          40 :     InputParameters params = _factory.getValidParams(material_type);
     351             : 
     352          60 :     params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
     353          40 :     params.set<unsigned int>("phase") = phase;
     354          40 :     params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
     355          40 :     params.set<bool>("compute_internal_energy") = compute_internal_energy;
     356          40 :     params.set<bool>("compute_enthalpy") = compute_enthalpy;
     357          40 :     params.set<UserObjectName>("fp") = fp;
     358             : 
     359          20 :     std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
     360          20 :     if (at_nodes)
     361             :       material_name = "PorousFlowActionBase_FluidProperties";
     362             : 
     363          40 :     params.set<bool>("at_nodes") = at_nodes;
     364          20 :     _problem->addMaterial(material_type, material_name, params);
     365             :   }
     366         100 : }
     367             : 
     368             : void
     369          10 : PorousFlowActionBase::addBrineMaterial(VariableName nacl_brine,
     370             :                                        bool at_nodes,
     371             :                                        unsigned phase,
     372             :                                        bool compute_density_and_viscosity,
     373             :                                        bool compute_internal_energy,
     374             :                                        bool compute_enthalpy)
     375             : {
     376          20 :   if (_current_task == "add_material")
     377             :   {
     378           2 :     std::string material_type = "PorousFlowBrine";
     379           4 :     InputParameters params = _factory.getValidParams(material_type);
     380             : 
     381           6 :     params.set<std::vector<VariableName>>("xnacl") = {nacl_brine};
     382           6 :     params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
     383           4 :     params.set<unsigned int>("phase") = phase;
     384           4 :     params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
     385           4 :     params.set<bool>("compute_internal_energy") = compute_internal_energy;
     386           4 :     params.set<bool>("compute_enthalpy") = compute_enthalpy;
     387             : 
     388           2 :     std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
     389           2 :     if (at_nodes)
     390             :       material_name = "PorousFlowActionBase_FluidProperties";
     391             : 
     392           4 :     params.set<bool>("at_nodes") = at_nodes;
     393           2 :     _problem->addMaterial(material_type, material_name, params);
     394             :   }
     395          10 : }
     396             : 
     397             : void
     398          80 : PorousFlowActionBase::addRelativePermeabilityCorey(
     399             :     bool at_nodes, unsigned phase, Real n, Real s_res, Real sum_s_res)
     400             : 
     401             : {
     402         160 :   if (_current_task == "add_material")
     403             :   {
     404          16 :     std::string material_type = "PorousFlowRelativePermeabilityCorey";
     405          32 :     InputParameters params = _factory.getValidParams(material_type);
     406             : 
     407          48 :     params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
     408          32 :     params.set<Real>("n") = n;
     409          32 :     params.set<unsigned int>("phase") = phase;
     410          32 :     params.set<Real>("s_res") = s_res;
     411          32 :     params.set<Real>("sum_s_res") = sum_s_res;
     412             : 
     413          16 :     std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
     414          16 :     if (at_nodes)
     415             :       material_name = "PorousFlowActionBase_RelativePermeability_nodal";
     416             : 
     417          32 :     params.set<bool>("at_nodes") = at_nodes;
     418          16 :     _problem->addMaterial(material_type, material_name, params);
     419             :   }
     420          80 : }
     421             : 
     422             : void
     423          10 : PorousFlowActionBase::addRelativePermeabilityFLAC(
     424             :     bool at_nodes, unsigned phase, Real m, Real s_res, Real sum_s_res)
     425             : {
     426          20 :   if (_current_task == "add_material")
     427             :   {
     428           2 :     std::string material_type = "PorousFlowRelativePermeabilityFLAC";
     429           4 :     InputParameters params = _factory.getValidParams(material_type);
     430             : 
     431           6 :     params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
     432           4 :     params.set<Real>("m") = m;
     433           4 :     params.set<unsigned int>("phase") = phase;
     434           4 :     params.set<Real>("s_res") = s_res;
     435           4 :     params.set<Real>("sum_s_res") = sum_s_res;
     436             : 
     437           2 :     std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
     438           2 :     if (at_nodes)
     439             :       material_name = "PorousFlowActionBase_RelativePermeability_nodal";
     440             : 
     441           4 :     params.set<bool>("at_nodes") = at_nodes;
     442           2 :     _problem->addMaterial(material_type, material_name, params);
     443             :   }
     444          10 : }
     445             : 
     446             : void
     447          25 : PorousFlowActionBase::addCapillaryPressureVG(Real m, Real alpha, std::string userobject_name)
     448             : {
     449          50 :   if (_current_task == "add_user_object")
     450             :   {
     451           5 :     std::string userobject_type = "PorousFlowCapillaryPressureVG";
     452          10 :     InputParameters params = _factory.getValidParams(userobject_type);
     453          10 :     params.set<Real>("m") = m;
     454          10 :     params.set<Real>("alpha") = alpha;
     455          15 :     _problem->addUserObject(userobject_type, userobject_name, params);
     456             :   }
     457          25 : }
     458             : 
     459             : void
     460         380 : PorousFlowActionBase::addJoiner(bool at_nodes,
     461             :                                 const std::string & material_property,
     462             :                                 const std::string & output_name)
     463             : {
     464         760 :   if (_current_task == "add_material")
     465             :   {
     466          76 :     std::string material_type = "PorousFlowJoiner";
     467         152 :     InputParameters params = _factory.getValidParams(material_type);
     468         228 :     params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
     469         152 :     params.set<bool>("at_nodes") = at_nodes;
     470         152 :     params.set<std::string>("material_property") = material_property;
     471          76 :     _problem->addMaterial(material_type, output_name, params);
     472             :   }
     473         380 : }
     474             : 
     475             : void
     476         110 : PorousFlowActionBase::joinDensity(bool at_nodes)
     477             : {
     478         110 :   if (at_nodes)
     479         120 :     addJoiner(at_nodes,
     480             :               "PorousFlow_fluid_phase_density_nodal",
     481          40 :               "PorousFlowActionBase_fluid_phase_density_all");
     482             :   else
     483         210 :     addJoiner(at_nodes,
     484             :               "PorousFlow_fluid_phase_density_qp",
     485          70 :               "PorousFlowActionBase_fluid_phase_density_qp_all");
     486         110 : }
     487             : 
     488             : void
     489         110 : PorousFlowActionBase::joinViscosity(bool at_nodes)
     490             : {
     491         110 :   if (at_nodes)
     492         120 :     addJoiner(at_nodes, "PorousFlow_viscosity_nodal", "PorousFlowActionBase_viscosity_all");
     493             :   else
     494         210 :     addJoiner(at_nodes, "PorousFlow_viscosity_qp", "PorousFlowActionBase_viscosity_qp_all");
     495         110 : }
     496             : 
     497             : void
     498          90 : PorousFlowActionBase::joinRelativePermeability(bool at_nodes)
     499             : {
     500          90 :   if (at_nodes)
     501          75 :     addJoiner(at_nodes,
     502             :               "PorousFlow_relative_permeability_nodal",
     503          25 :               "PorousFlowActionBase_relative_permeability_all");
     504             :   else
     505         195 :     addJoiner(at_nodes,
     506             :               "PorousFlow_relative_permeability_qp",
     507          65 :               "PorousFlowActionBase_relative_permeability_qp_all");
     508          90 : }
     509             : 
     510             : void
     511          40 : PorousFlowActionBase::joinInternalEnergy(bool at_nodes)
     512             : {
     513          40 :   if (at_nodes)
     514          45 :     addJoiner(at_nodes,
     515             :               "PorousFlow_fluid_phase_internal_energy_nodal",
     516          15 :               "PorousFlowActionBase_fluid_phase_internal_energy_all");
     517             :   else
     518          75 :     addJoiner(at_nodes,
     519             :               "PorousFlow_fluid_phase_internal_energy_qp",
     520          25 :               "PorousFlowActionBase_fluid_phase_internal_energy_qp_all");
     521          40 : }
     522             : 
     523             : void
     524          30 : PorousFlowActionBase::joinEnthalpy(bool at_nodes)
     525             : {
     526          30 :   if (at_nodes)
     527          15 :     addJoiner(at_nodes,
     528             :               "PorousFlow_fluid_phase_enthalpy_nodal",
     529           5 :               "PorousFlowActionBase_fluid_phase_enthalpy_all");
     530             :   else
     531          75 :     addJoiner(at_nodes,
     532             :               "PorousFlow_fluid_phase_enthalpy_qp",
     533          25 :               "PorousFlowActionBase_fluid_phase_enthalpy_qp_all");
     534        2529 : }

Generated by: LCOV version 1.11