Example #1
0
void
ActionWarehouse::buildBuildableActions(const std::string & task)
{
  if (_syntax.shouldAutoBuild(task) && _action_blocks[task].empty())
  {
    bool ret_value = false;
    auto it_pair = _action_factory.getActionsByTask(task);
    for (const auto & action_pair : as_range(it_pair))
    {
      InputParameters params = _action_factory.getValidParams(action_pair.second);
      params.set<ActionWarehouse *>("awh") = this;

      if (params.areAllRequiredParamsValid())
      {
        params.set<std::string>("registered_identifier") = "(AutoBuilt)";
        addActionBlock(_action_factory.create(action_pair.second, "", params));
        ret_value = true;
      }
    }

    if (!ret_value)
      _unsatisfied_dependencies.insert(task);
  }
}
Example #2
0
InputParameters
validParams<PorousFlowDarcyBase>()
{
  InputParameters params = validParams<Kernel>();
  params.addRequiredParam<RealVectorValue>("gravity",
                                           "Gravitational acceleration vector downwards (m/s^2)");
  params.addRequiredParam<UserObjectName>(
      "PorousFlowDictator", "The UserObject that holds the list of PorousFlow variable names");
  params.addParam<unsigned>("full_upwind_threshold",
                            5,
                            "If, for each timestep, the number of "
                            "upwind-downwind swaps in an element is less than "
                            "this quantity, then full upwinding is used for that element.  "
                            "Otherwise the fallback scheme is employed.");
  MooseEnum fallback_enum("quick harmonic", "quick");
  params.addParam<MooseEnum>("fallback_scheme",
                             fallback_enum,
                             "quick: use nodal mobility without "
                             "preserving mass.  harmonic: use a "
                             "harmonic mean of nodal mobilities "
                             "and preserve fluid mass");
  params.addClassDescription("Fully-upwinded advective Darcy flux");
  return params;
}
Example #3
0
GluedContactConstraint::GluedContactConstraint(const std::string & name, InputParameters parameters) :
    SparsityBasedContactConstraint(name, parameters),
  _component(getParam<unsigned int>("component")),
  _model(contactModel(getParam<std::string>("model"))),
  _formulation(contactFormulation(getParam<std::string>("formulation"))),
  _penalty(getParam<Real>("penalty")),
  _friction_coefficient(getParam<Real>("friction_coefficient")),
  _tension_release(getParam<Real>("tension_release")),
  _updateContactSet(true),
  _time_last_called(-std::numeric_limits<Real>::max()),
  _residual_copy(_sys.residualGhosted()),
  _x_var(isCoupled("disp_x") ? coupled("disp_x") : 99999),
  _y_var(isCoupled("disp_y") ? coupled("disp_y") : 99999),
  _z_var(isCoupled("disp_z") ? coupled("disp_z") : 99999),
  _vars(_x_var, _y_var, _z_var),
  _nodal_area_var(getVar("nodal_area", 0)),
  _aux_system( _nodal_area_var->sys() ),
  _aux_solution( _aux_system.currentSolution() )
{
//  _overwrite_slave_residual = false;

  if (parameters.isParamValid("tangential_tolerance"))
  {
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));
  }
  if (parameters.isParamValid("normal_smoothing_distance"))
  {
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));
  }
  if (parameters.isParamValid("normal_smoothing_method"))
  {
    _penetration_locator.setNormalSmoothingMethod(parameters.get<std::string>("normal_smoothing_method"));
  }

  _penetration_locator.setUpdate(false);
}
Example #4
0
InputParameters validParams<CreateExecutionerAction>()
{
  InputParameters params = validParams<MooseObjectAction>();
  params.addParam<Real>        ("l_tol",           1.0e-5,   "Linear Tolerance");
  params.addParam<Real>        ("l_abs_step_tol",  -1,       "Linear Absolute Step Tolerance");
  params.addParam<unsigned int>("l_max_its",       10000,    "Max Linear Iterations");
  params.addParam<unsigned int>("nl_max_its",      50,       "Max Nonlinear Iterations");
  params.addParam<unsigned int>("nl_max_funcs",    10000,    "Max Nonlinear solver function evaluations");
  params.addParam<Real>        ("nl_abs_tol",      1.0e-50,  "Nonlinear Absolute Tolerance");
  params.addParam<Real>        ("nl_rel_tol",      1.0e-8,   "Nonlinear Relative Tolerance");
  params.addParam<Real>        ("nl_abs_step_tol", 1.0e-50,  "Nonlinear Absolute step Tolerance");
  params.addParam<Real>        ("nl_rel_step_tol", 1.0e-50,  "Nonlinear Relative step Tolerance");
  params.addParam<bool>        ("no_fe_reinit",    false,    "Specifies whether or not to reinitialize FEs");
  params.addParam<bool>        ("compute_initial_residual_before_preset_bcs", false,
                                "Use the residual norm computed *before* PresetBCs are imposed in relative convergence check");

  CreateExecutionerAction::populateCommonExecutionerParams(params);

  params.addParamNamesToGroup("l_tol l_abs_step_tol l_max_its nl_max_its nl_max_funcs "
                              "nl_abs_tol nl_rel_tol nl_abs_step_tol nl_rel_step_tol compute_initial_residual_before_preset_bcs", "Solver");
  params.addParamNamesToGroup("no_fe_reinit", "Advanced");

  return params;
}
Example #5
0
InputParameters
validParams<PorousFlowBasicTHM>()
{
  InputParameters params = validParams<PorousFlowSinglePhaseBase>();
  params.addParam<bool>("multiply_by_density",
                        false,
                        "If true, then the Kernels for fluid flow are multiplied by "
                        "the fluid density.  If false, this multiplication is not "
                        "performed, which means the problem linearises, but that care "
                        "must be taken when using other PorousFlow objects.");
  params.addClassDescription("Adds Kernels and fluid-property Materials necessary to simulate a "
                             "single-phase, single-component fully-saturated flow problem.  No "
                             "upwinding and no mass lumping of the fluid mass are used.  The "
                             "fluid-mass time derivative is close to linear, and is perfectly "
                             "linear if multiply_by_density=false.  These features mean the "
                             "results may differ slightly from the "
                             "Unsaturated Action case.  To run a simulation "
                             "you will also need to provide various other Materials for each mesh "
                             "block, depending on your simulation type, viz: permeability, "
                             "constant Biot modulus, constant thermal expansion coefficient, "
                             "porosity, elasticity tensor, strain calculator, stress calculator, "
                             "matrix internal energy, thermal conductivity, diffusivity");
  return params;
}
InputParameters
validParams<PorousFlowFullySaturatedMassTimeDerivative>()
{
  InputParameters params = validParams<TimeKernel>();
  MooseEnum coupling_type("Hydro ThermoHydro HydroMechanical ThermoHydroMechanical", "Hydro");
  params.addParam<MooseEnum>("coupling_type",
                             coupling_type,
                             "The type of simulation.  For simulations involving Mechanical "
                             "deformations, you will need to supply the correct Biot coefficient.  "
                             "For simulations involving Thermal flows, you will need an associated "
                             "ConstantThermalExpansionCoefficient Material");
  params.addRangeCheckedParam<Real>(
      "biot_coefficient", 1.0, "biot_coefficient>=0 & biot_coefficient<=1", "Biot coefficient");
  params.addParam<bool>("multiply_by_density",
                        true,
                        "If true, then this Kernel is the time derivative of the fluid "
                        "mass.  If false, then this Kernel is the derivative of the "
                        "fluid volume (which is common in poro-mechanics)");
  params.addRequiredParam<UserObjectName>(
      "PorousFlowDictator", "The UserObject that holds the list of Porous-Flow variable names.");
  params.addClassDescription("Fully-saturated version of the single-component, single-phase fluid "
                             "mass derivative wrt time");
  return params;
}
Example #7
0
InputParameters validParams<GeneratedMesh>()
{
  InputParameters params = validParams<MooseMesh>();

  MooseEnum elem_types("EDGE, EDGE2, EDGE3, EDGE4, QUAD, QUAD4, QUAD8, QUAD9, TRI3, TRI6, HEX, HEX8, HEX20, HEX27, TET4, TET10, PRISM6, PRISM15, PRISM18"); // no default

  MooseEnum dims("1 = 1, 2, 3");
  params.addRequiredParam<MooseEnum>("dim", dims, "The dimension of the mesh to be generated"); // Make this parameter required

  params.addParam<int>("nx", 1, "Number of elements in the X direction");
  params.addParam<int>("ny", 1, "Number of elements in the Y direction");
  params.addParam<int>("nz", 1, "Number of elements in the Z direction");
  params.addParam<Real>("xmin", 0.0, "Lower X Coordinate of the generated mesh");
  params.addParam<Real>("ymin", 0.0, "Lower Y Coordinate of the generated mesh");
  params.addParam<Real>("zmin", 0.0, "Lower Z Coordinate of the generated mesh");
  params.addParam<Real>("xmax", 1.0, "Upper X Coordinate of the generated mesh");
  params.addParam<Real>("ymax", 1.0, "Upper Y Coordinate of the generated mesh");
  params.addParam<Real>("zmax", 1.0, "Upper Z Coordinate of the generated mesh");
  params.addParam<MooseEnum>("elem_type", elem_types, "The type of element from libMesh to generate (default: linear element for requested dimension)");

  params.addParamNamesToGroup("dim", "Main");

  return params;
}
Example #8
0
InputParameters
validParams<RelationshipManager>()
{
  InputParameters params = validParams<MooseObject>();

  /**
   * Param to indicate whether all necessary GeometricRelationshipManagers can be attached during
   * the setup of the mesh. When true (and when running with DistributedMesh) the framework can
   * perform two optimizations:
   *
   * 1) Elements not needed by any ghosting functor can be safely deleted during Mesh::init() prior
   *    to building the EquationSystems object or other MOOSE objects. This may result in
   *    significant memory savings during the setup phase.
   *
   * 2) A late mesh reinitialization can be skipped reducing the overall setup time of the
   *    simulation.
   *
   * When in doubt and to allow for maximum flexibility, developers may choose to return false here
   * to simplify setting up Algebraic and Geometric at the same time.
   */
  params.addPrivateParam<bool>("attach_geometric_early", true);

  /**
   * This parameter indicates which type of RelationshipManager this class represents prior to its
   * construction. Geometric-only RelationshipManagers may be buildable early in which case the
   * framework can optimize memory usage for Distributed Mesh by allowing remote elements to be
   * deleted. Depending on the mesh size and EquationSystems size, this may have a significant
   * impact on total memory usage during the problem setup phase.
   */
  params.addPrivateParam<Moose::RelationshipManagerType>("rm_type");

  // Set by MOOSE
  params.addPrivateParam<MooseMesh *>("mesh");
  params.registerBase("RelationshipManager");
  return params;
}
Example #9
0
PenetrationAux::PenetrationAux(const InputParameters & parameters) :
    AuxKernel(parameters),

    // Here we cast the value of the MOOSE enum to an integer to the class-based enum.
    _quantity(PenetrationAux::PA_ENUM(int(getParam<MooseEnum>("quantity")))),
    _penetration_locator(_nodal
      ? getPenetrationLocator(
          parameters.get<BoundaryName>("paired_boundary"),
          boundaryNames()[0],
          Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order")))
      : getQuadraturePenetrationLocator(
          parameters.get<BoundaryName>("paired_boundary"),
          boundaryNames()[0],
          Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order"))))
{
  if (parameters.isParamValid("tangential_tolerance"))
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));

  if (parameters.isParamValid("normal_smoothing_distance"))
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));

  if (parameters.isParamValid("normal_smoothing_method"))
    _penetration_locator.setNormalSmoothingMethod(parameters.get<std::string>("normal_smoothing_method"));
}
Example #10
0
InputParameters validParams<Exodus>()
{
  // Get the base class parameters
  InputParameters params = validParams<AdvancedOutput<OversampleOutput> >();
  params += AdvancedOutput<OversampleOutput>::enableOutputTypes("nodal elemental scalar postprocessor input");

  // Enable sequential file output (do not set default, the use_displace criteria relies on isParamValid, see Constructor)
  params.addParam<bool>("sequence", "Enable/disable sequential file output (enabled by default when 'use_displace = true', otherwise defaults to false");

  // Select problem dimension for mesh output
  params.addParam<bool>("use_problem_dimension", "Use the problem dimension to the mesh output. Set to false when outputting lower dimensional meshes embedded in a higher dimensional space.");

  // Set the default padding to 3
  params.set<unsigned int>("padding") = 3;

  // Add description for the Exodus class
  params.addClassDescription("Object for output data in the Exodus II format");

  // Set outputting of the input to be on by default
  params.set<MultiMooseEnum>("execute_input_on") = "initial";

  // Return the InputParameters
  return params;
}
Example #11
0
InputParameters
validParams<AnnularMesh>()
{
  InputParameters params = validParams<MooseMesh>();
  params.addRangeCheckedParam<unsigned int>(
      "nr", 1, "nr>0", "Number of elements in the radial direction");
  params.addRequiredRangeCheckedParam<unsigned int>(
      "nt", "nt>0", "Number of elements in the angular direction");
  params.addRequiredRangeCheckedParam<Real>(
      "rmin",
      "rmin>=0.0",
      "Inner radius.  If rmin=0 then a disc mesh (with no central hole) will be created.");
  params.addRequiredParam<Real>("rmax", "Outer radius");
  params.addParam<Real>("tmin", 0.0, "Minimum angle, measured anticlockwise from x axis");
  params.addParam<Real>("tmax",
                        2 * M_PI,
                        "Maximum angle, measured anticlockwise from x axis.  If "
                        "tmin=0 and tmax=2Pi an annular mesh is created.  "
                        "Otherwise, only a sector of an annulus is created");
  params.addRangeCheckedParam<Real>(
      "growth_r", 1.0, "growth_r>0.0", "The ratio of radial sizes of successive rings of elements");
  params.addParam<SubdomainID>(
      "quad_subdomain_id", 0, "The subdomain ID given to the QUAD4 elements");
  params.addParam<SubdomainID>("tri_subdomain_id",
                               1,
                               "The subdomain ID given to the TRI3 elements "
                               "(these exist only if rmin=0, and they exist "
                               "at the center of the disc");
  params.addClassDescription("For rmin>0: creates an annular mesh of QUAD4 elements.  For rmin=0: "
                             "creates a disc mesh of QUAD4 and TRI3 elements.  Boundary sidesets "
                             "are created at rmax and rmin, and given these names.  If tmin!=0 and "
                             "tmax!=2Pi, a sector of an annulus or disc is created.  In this case "
                             "boundary sidesets are also created a tmin and tmax, and "
                             "given these names");
  return params;
}
Example #12
0
InputParameters validParams<NodalKernel>()
{
  InputParameters params = validParams<MooseObject>();
  params += validParams<TransientInterface>();
  params += validParams<BlockRestrictable>();
  params += validParams<BoundaryRestrictable>();
  params += validParams<RandomInterface>();

  params.addRequiredParam<NonlinearVariableName>("variable", "The name of the variable that this boundary condition applies to");

  params.addParam<std::vector<AuxVariableName> >("save_in", "The name of auxiliary variables to save this BC's residual contributions to.  Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)");

  params.addParam<std::vector<AuxVariableName> >("diag_save_in", "The name of auxiliary variables to save this BC's diagonal jacobian contributions to.  Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)");


  params.addParam<bool>("use_displaced_mesh", false, "Whether or not this object should use the displaced mesh for computation.  Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.");
  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");

  params.declareControllable("enable");

  params.registerBase("NodalKernel");

  return params;
}
Example #13
0
InputParameters validParams<Output>()
{
  // Get the parameters from the parent object
  InputParameters params = validParams<MooseObject>();

  // Displaced Mesh options
  params.addParam<bool>("use_displaced", false, "Enable/disable the use of the displaced mesh for outputting");

  // Output intervals and timing
  params.addParam<unsigned int>("interval", 1, "The interval at which time steps are output to the solution file");
  params.addParam<std::vector<Real> >("sync_times", "Times at which the output and solution is forced to occur");
  params.addParam<bool>("sync_only", false, "Only export results at sync times");
  params.addParam<Real>("start_time", "Time at which this output object begins to operate");
  params.addParam<Real>("end_time", "Time at which this output object stop operating");
  params.addParam<Real>("time_tolerance", 1e-14, "Time tolerance utilized checking start and end times");

  // Add the 'execute_on' input parameter for users to set
  params.addParam<MultiMooseEnum>("execute_on", Output::getExecuteOptions("initial timestep_end"), "Set to (none|initial|linear|nonlinear|timestep_end|timestep_begin|final|failed|custom) to execute only at that moment");

  // Add ability to append to the 'execute_on' list
  params.addParam<MultiMooseEnum>("additional_execute_on", Output::getExecuteOptions(), "This list of output flags is added to the existing flags (initial|linear|nonlinear|timestep_end|timestep_begin|final|failed|custom) to execute only at that moment");

  // 'Timing' group
  params.addParamNamesToGroup("time_tolerance interval output_initial output_final sync_times sync_only start_time end_time ", "Timing");

  // Add a private parameter for indicating if it was created with short-cut syntax
  params.addPrivateParam<bool>("_built_by_moose", false);

  // Register this class as base class
  params.registerBase("Output");

  //**** DEPRECATED SUPPORT ****
  Output::addDeprecatedInputParameters(params);

  return params;
}
Example #14
0
InputParameters
validParams<KKSCHBulk>()
{
  InputParameters params = CHBulk<Real>::validParams();
  params.addClassDescription("KKS model kernel for the Bulk Cahn-Hilliard term. This operates on "
                             "the concentration 'c' as the non-linear variable");
  params.addRequiredParam<MaterialPropertyName>("fa_name",
                                                "Base name of the free energy function "
                                                "F (f_name in the corresponding "
                                                "derivative function material)");
  params.addRequiredParam<MaterialPropertyName>("fb_name",
                                                "Base name of the free energy function "
                                                "F (f_name in the corresponding "
                                                "derivative function material)");
  params.addRequiredCoupledVar(
      "ca", "phase concentration corresponding to the non-linear variable of this kernel");
  params.addRequiredCoupledVar(
      "cb", "phase concentration corresponding to the non-linear variable of this kernel");
  params.addCoupledVar("args_a", "Vector of additional arguments to Fa");
  params.addParam<MaterialPropertyName>(
      "h_name", "h", "Base name for the switching function h(eta)"); // TODO: everywhere else this
                                                                     // is called just "h"
  return params;
}
Example #15
0
InputParameters
validParams<UserObject>()
{
  InputParameters params = validParams<MooseObject>();

  // Add the SetupInterface parameter, 'execute_on', and set it to a default of 'timestep_end'
  params += validParams<SetupInterface>();
  params.set<MultiMooseEnum>("execute_on") = "timestep_end";

  params.addParam<bool>("use_displaced_mesh",
                        false,
                        "Whether or not this object should use the "
                        "displaced mesh for computation.  Note that "
                        "in the case this is true but no "
                        "displacements are provided in the Mesh block "
                        "the undisplaced mesh will still be used.");
  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");

  params.declareControllable("enable");

  params.registerBase("UserObject");

  return params;
}
ComputeIsotropicElasticityTensor::ComputeIsotropicElasticityTensor(const InputParameters & parameters) :
    ComputeElasticityTensorBase(parameters),
    _bulk_modulus_set( parameters.isParamValid("bulk_modulus") ),
    _lambda_set( parameters.isParamValid("lambda") ),
    _poissons_ratio_set( parameters.isParamValid("poissons_ratio") ),
    _shear_modulus_set( parameters.isParamValid("shear_modulus") ),
    _youngs_modulus_set( parameters.isParamValid("youngs_modulus") ),
    _bulk_modulus( _bulk_modulus_set ? getParam<Real>("bulk_modulus") : -1 ),
    _lambda( _lambda_set ? getParam<Real>("lambda") : -1 ),
    _poissons_ratio( _poissons_ratio_set ?  getParam<Real>("poissons_ratio") : -1 ),
    _shear_modulus( _shear_modulus_set ? getParam<Real>("shear_modulus") : -1 ),
    _youngs_modulus( _youngs_modulus_set ? getParam<Real>("youngs_modulus") : -1 )
{
    std::vector<Real> iso_const(2);

    if (_lambda_set && _shear_modulus_set)
    {
        iso_const[0] = _lambda;
        iso_const[1] = _shear_modulus;
    }
    else if (_youngs_modulus_set && _poissons_ratio_set)
    {
        iso_const[0] = _youngs_modulus*_poissons_ratio/((1 + _poissons_ratio)*(1 - 2*_poissons_ratio));
        iso_const[1] = _youngs_modulus/(2*(1 + _poissons_ratio));
    }
    else if (_shear_modulus_set && _bulk_modulus_set)
    {
        iso_const[0] = _bulk_modulus - 2.0/3.0*_shear_modulus;
        iso_const[1] = _shear_modulus;
    }
    else
        mooseError("Incorrect combination of elastic properties in ComputeIsotropicElasticityTensor. Possible combinations are: lambda and shear_modulus, youngs_modulus and poissons_ratio, or bulk_modulus and shear_modulus.");

    //Fill elasticity tensor
    _Cijkl.fillFromInputVector(iso_const, RankFourTensor::symmetric_isotropic);
}
Example #17
0
void
PorousFlowActionBase::addMassFractionMaterial(bool at_nodes)
{
  if (_current_task == "add_material")
  {
    if (!(parameters().hasDefaultCoupledValue("mass_fraction_vars") ||
          parameters().hasCoupledValue("mass_fraction_vars")))
      mooseError("Attempt to add a PorousFlowMassFraction material without setting the "
                 "mass_fraction_vars");

    std::string material_type = "PorousFlowMassFraction";
    InputParameters params = _factory.getValidParams(material_type);

    params.applySpecificParameters(parameters(), {"mass_fraction_vars"});
    params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;

    std::string material_name = "PorousFlowActionBase_MassFraction_qp";
    if (at_nodes)
      material_name = "PorousFlowActionBase_MassFraction";

    params.set<bool>("at_nodes") = at_nodes;
    _problem->addMaterial(material_type, material_name, params);
  }
}
Example #18
0
InputParameters
validParams<InteractionIntegral>()
{
  InputParameters params = validParams<ElementIntegralPostprocessor>();
  params.addRequiredCoupledVar(
      "displacements",
      "The displacements appropriate for the simulation geometry and coordinate system");
  params.addCoupledVar("temp",
                       "The temperature (optional). Must be provided to correctly compute "
                       "stress intensity factors in models with thermal strain gradients.");
  params.addRequiredParam<UserObjectName>("crack_front_definition",
                                          "The CrackFrontDefinition user object name");
  params.addParam<unsigned int>(
      "crack_front_point_index",
      "The index of the point on the crack front corresponding to this q function");
  params.addParam<Real>(
      "K_factor", "Conversion factor between interaction integral and stress intensity factor K");
  params.addParam<unsigned int>("symmetry_plane",
                                "Account for a symmetry plane passing through "
                                "the plane of the crack, normal to the specified "
                                "axis (0=x, 1=y, 2=z)");
  params.addParam<Real>("poissons_ratio", "Poisson's ratio for the material.");
  params.addParam<Real>("youngs_modulus", "Young's modulus of the material.");
  params.set<bool>("use_displaced_mesh") = false;
  params.addParam<unsigned int>("ring_index", "Ring ID");
  params.addParam<MooseEnum>("q_function_type",
                             InteractionIntegral::qFunctionType(),
                             "The method used to define the integration domain. Options are: " +
                                 InteractionIntegral::qFunctionType().getRawNames());
  params.addRequiredParam<MooseEnum>("sif_mode",
                                     InteractionIntegral::sifModeType(),
                                     "Stress intensity factor to calculate. Choices are: " +
                                         InteractionIntegral::sifModeType().getRawNames());

  return params;
}
InterfaceChargeTransferButler::InterfaceChargeTransferButler(const InputParameters & parameters) :
    InterfaceKernel(parameters),
    _E_rev(getParam<Real>("E_rev")),
    _phi_LSM(getParam<Real>("phi_LSM")),
    _j0(getParam<Real>("j0")),
    _R(getParam<Real>("R")),
    _T(getParam<Real>("T")),
    _z(getParam<Real>("z")),
    _F(getParam<Real>("F"))
{
  if (!parameters.isParamValid("boundary"))
  {
    mooseError("In order to use the InterfaceChargeTransfer dgkernel, you must specify a boundary where it will live.");
  }
}
Example #20
0
InputParameters
validParams<StressDivergence>()
{
  InputParameters params = validParams<Kernel>();
  params.addRequiredParam<unsigned int>("component",
                                        "An integer corresponding to the direction "
                                        "the variable this kernel acts in. (0 for x, "
                                        "1 for y, 2 for z)");
  params.addCoupledVar("disp_x", "The x displacement");
  params.addCoupledVar("disp_y", "The y displacement");
  params.addCoupledVar("disp_z", "The z displacement");
  params.addCoupledVar("temp", "The temperature");
  params.addParam<Real>("zeta", 0.0, "Stiffness dependent Rayleigh damping coefficient");
  params.addParam<Real>("alpha", 0.0, "alpha parameter required for HHT time integration");
  params.addParam<std::string>(
      "appended_property_name", "", "Name appended to material properties to make them unique");
  params.addParam<bool>("volumetric_locking_correction",
                        true,
                        "Set to false to turn off volumetric locking correction");

  params.set<bool>("use_displaced_mesh") = true;

  return params;
}
Example #21
0
InputParameters
validParams<EBSDMesh>()
{
  InputParameters params = validParams<GeneratedMesh>();
  params.addClassDescription("Mesh generated from a specified DREAM.3D EBSD data file.");
  params.addRequiredParam<FileName>("filename", "The name of the file containing the EBSD data");
  params.addParam<unsigned int>(
      "uniform_refine", 0, "Number of coarsening levels available in adaptive mesh refinement.");

  // suppress parameters
  params.suppressParameter<MooseEnum>("dim");
  params.set<MooseEnum>("dim") = MooseEnum("1=1 2 3", "1");
  params.suppressParameter<unsigned int>("nx");
  params.suppressParameter<unsigned int>("ny");
  params.suppressParameter<unsigned int>("nz");
  params.suppressParameter<Real>("xmin");
  params.suppressParameter<Real>("ymin");
  params.suppressParameter<Real>("zmin");
  params.suppressParameter<Real>("xmax");
  params.suppressParameter<Real>("ymax");
  params.suppressParameter<Real>("zmax");

  return params;
}
Example #22
0
GapConductance::GapConductance(const std::string & name, InputParameters parameters)
  :Material(name, parameters),
   _appended_property_name( getParam<std::string>("appended_property_name") ),
   _temp(coupledValue("variable")),
   _quadrature(getParam<bool>("quadrature")),
   _gap_temp(0),
   _gap_distance(88888),
   _has_info(false),
   _gap_distance_value(_quadrature ? _zero : coupledValue("gap_distance")),
   _gap_temp_value(_quadrature ? _zero : coupledValue("gap_temp")),
   _gap_conductance(declareProperty<Real>("gap_conductance"+_appended_property_name)),
   _gap_conductance_dT(declareProperty<Real>("gap_conductance"+_appended_property_name+"_dT")),
   _gap_conductivity(getParam<Real>("gap_conductivity")),
   _gap_conductivity_function(isParamValid("gap_conductivity_function") ? &getFunction("gap_conductivity_function") : NULL),
   _gap_conductivity_function_variable(isCoupled("gap_conductivity_function_variable") ? &coupledValue("gap_conductivity_function_variable") : NULL),
   _stefan_boltzmann(getParam<Real>("stefan_boltzmann")),
   _emissivity( getParam<Real>("emissivity_1") != 0 && getParam<Real>("emissivity_2") != 0 ?
                1/getParam<Real>("emissivity_1") + 1/getParam<Real>("emissivity_2") - 1 : 0 ),
   _min_gap(getParam<Real>("min_gap")),
   _max_gap(getParam<Real>("max_gap")),
   _temp_var(_quadrature ? getVar("variable",0) : NULL),
   _penetration_locator(NULL),
   _serialized_solution(_quadrature ? &_temp_var->sys().currentSolution() : NULL),
   _dof_map(_quadrature ? &_temp_var->sys().dofMap() : NULL),
   _warnings(getParam<bool>("warnings"))
{
  if(_quadrature)
  {
    if(!parameters.isParamValid("paired_boundary"))
      mooseError(std::string("No 'paired_boundary' provided for ") + _name);
  }
  else
  {
    if(!isCoupled("gap_distance"))
      mooseError(std::string("No 'gap_distance' provided for ") + _name);

    if(!isCoupled("gap_temp"))
      mooseError(std::string("No 'gap_temp' provided for ") + _name);
  }


  if(_quadrature)
  {
    _penetration_locator = &_subproblem.geomSearchData().getQuadraturePenetrationLocator(parameters.get<BoundaryName>("paired_boundary"),
                                                                                         getParam<std::vector<BoundaryName> >("boundary")[0],
                                                                                         Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order")));
  }
}
PorousFlowThermalConductivityIdeal::PorousFlowThermalConductivityIdeal(const InputParameters & parameters) :
    PorousFlowMaterialVectorBase(parameters),
    _la_dry(getParam<RealTensorValue>("dry_thermal_conductivity")),
    _wet_and_dry_differ(parameters.isParamValid("wet_thermal_conductivity")),
    _la_wet(_wet_and_dry_differ ? getParam<RealTensorValue>("wet_thermal_conductivity") : getParam<RealTensorValue>("dry_thermal_conductivity")),
    _exponent(getParam<Real>("exponent")),
    _aqueous_phase(_num_phases > 0),
    _aqueous_phase_number(getParam<unsigned>("aqueous_phase_number")),
    _saturation_qp(_aqueous_phase ? &getMaterialProperty<std::vector<Real> >("PorousFlow_saturation_qp") : nullptr),
    _dsaturation_qp_dvar(_aqueous_phase ? &getMaterialProperty<std::vector<std::vector<Real> > >("dPorousFlow_saturation_qp_dvar") : nullptr),
    _la_qp(declareProperty<RealTensorValue>("PorousFlow_thermal_conductivity_qp")),
    _dla_qp_dvar(declareProperty<std::vector<RealTensorValue> >("dPorousFlow_thermal_conductivity_qp_dvar"))
{
  if (_aqueous_phase && (_aqueous_phase_number >= _num_phases))
    mooseError("PorousFlowThermalConductivityIdeal: Your aqueous phase number, " << _aqueous_phase_number << " must not exceed the number of fluid phases in the system, which is " << _num_phases << "\n");
}
Example #24
0
InputParameters validParams<NSKernel>()
{
  InputParameters params = validParams<Kernel>();
  params.addRequiredCoupledVar(NS::velocity_x, "x-velocity");
  params.addCoupledVar(NS::velocity_y, "y-velocity"); // only required in 2D and 3D
  params.addCoupledVar(NS::velocity_z, "z-velocity"); // only required in 3D
  params.addRequiredCoupledVar(NS::density, "density");
  params.addRequiredCoupledVar(NS::momentum_x, "x-momentum");
  params.addCoupledVar(NS::momentum_y, "y-momentum"); // only required in 2D and 3D
  params.addCoupledVar(NS::momentum_z, "z-momentum"); // only required in 3D
  params.addRequiredCoupledVar(NS::total_energy, "total energy");
  params.addRequiredParam<UserObjectName>("fluid_properties", "The name of the user object for fluid properties");
  return params;
}
Example #25
0
GrainTracker::GrainTracker(const InputParameters & parameters) :
    FeatureFloodCount(parameters),
    _tracking_step(getParam<int>("tracking_step")),
    _hull_buffer(getParam<Real>("convex_hull_buffer")),
    _remap(getParam<bool>("remap_grains")),
    _nl(static_cast<FEProblem &>(_subproblem).getNonlinearSystem()),
    _unique_grains(declareRestartableData<std::map<unsigned int, UniqueGrain *> >("unique_grains")),
    _ebsd_reader(parameters.isParamValid("ebsd_reader") ? &getUserObject<EBSDReader>("ebsd_reader") : NULL),
    _compute_op_maps(getParam<bool>("compute_op_maps")),
    _center_mass_tracking(getParam<bool>("center_of_mass_tracking"))
{
  // Size the data structures to hold the correct number of maps
  _bounding_spheres.resize(_maps_size);

  if (!_is_elemental && _compute_op_maps)
    mooseError("\"compute_op_maps\" is only supported with \"flood_entity_type = ELEMENTAL\"");
}
Example #26
0
void
initPostprocessorOrVectorPostprocessorLists(OutputData & output_data, warehouse_type & warehouse, bool & has_limited_pps, MooseApp & app, std::string & name, InputParameters & params)
{
  // Loop through each of the execution flags
  for (unsigned int i = 0; i < Moose::exec_types.size(); i++)
  {
    // Loop through each of the postprocessors
    for (typename std::vector<postprocessor_type *>::const_iterator postprocessor_it = warehouse(Moose::exec_types[i])[0].all().begin();
         postprocessor_it != warehouse(Moose::exec_types[i])[0].all().end();
         ++postprocessor_it)
    {
      // Store the name in the available postprocessors
      postprocessor_type *pps = *postprocessor_it;
      output_data.available.push_back(pps->PPName());

      // Extract the list of outputs
      std::set<OutputName> pps_outputs = pps->getOutputs();

      // Check that the outputs are valid
      app.getOutputWarehouse().checkOutputs(pps_outputs);

      /* Hide the postprocessor if:
       *  (1) The "outputs" parameter is NOT empty and
       *  (2) 'all' is NOT found in the 'outputs' parameter and
       *  (3) 'none' is used within the 'outputs' parameter or
       *  (4) this output object name is not found in the list of output names
       */
      if ( !pps_outputs.empty() && pps_outputs.find("all") == pps_outputs.end() &&
           (pps_outputs.find("none") != pps_outputs.end() || pps_outputs.find(name) == pps_outputs.end()) )
        output_data.hide.push_back(pps->PPName());

      // Check that the output object allows postprocessor output, account for "all" keyword (if it is present assume "all" was desired)
      if ( pps_outputs.find(name) != pps_outputs.end() || pps_outputs.find("all") != pps_outputs.end() )
      {
        if (!params.isParamValid("output_postprocessors"))
          mooseWarning("Postprocessor '" << pps->PPName()
                       << "' has requested to be output by the '" << name
                       << "' output, but postprocessor output is not support by this type of output object.");
      }

      // Set the flag state for postprocessors that utilize 'outputs' parameter
      if (!pps_outputs.empty() && pps_outputs.find("all") == pps_outputs.end())
        has_limited_pps = true;
    }
  }
}
TensorMechanicsPlasticMohrCoulombMulti::TensorMechanicsPlasticMohrCoulombMulti(const InputParameters & parameters) :
    TensorMechanicsPlasticModel(parameters),
    _cohesion(getUserObject<TensorMechanicsHardeningModel>("cohesion")),
    _phi(getUserObject<TensorMechanicsHardeningModel>("friction_angle")),
    _psi(getUserObject<TensorMechanicsHardeningModel>("dilation_angle")),
    _max_iters(getParam<unsigned int>("max_iterations")),
    _shift(parameters.isParamValid("shift") ? getParam<Real>("shift") : _f_tol),
    _use_custom_returnMap(getParam<bool>("use_custom_returnMap"))
{
  if (_shift < 0)
    mooseError("Value of 'shift' in TensorMechanicsPlasticMohrCoulombMulti must not be negative\n");
  if (_shift > _f_tol)
    _console << "WARNING: value of 'shift' in TensorMechanicsPlasticMohrCoulombMulti is probably set too high\n";
  if (LIBMESH_DIM != 3)
    mooseError("TensorMechanicsPlasticMohrCoulombMulti is only defined for LIBMESH_DIM=3");
  MooseRandom::seed(0);
}
Example #28
0
ComputeStrainBase::ComputeStrainBase(const InputParameters & parameters) :
    DerivativeMaterialInterface<Material>(parameters),
    _ndisp(coupledComponents("displacements")),
    _disp(3),
    _grad_disp(3),
    _grad_disp_old(3),
    _T(coupledValue("temperature")),
    _T0(getParam<Real>("temperature_ref")),
    _thermal_expansion_coeff(getParam<Real>("thermal_expansion_coeff")),
    _no_thermal_eigenstrains(false),
    _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : "" ),
    _mechanical_strain(declareProperty<RankTwoTensor>(_base_name + "mechanical_strain")),
    _total_strain(declareProperty<RankTwoTensor>(_base_name + "total_strain")),
    _stateful_displacements(getParam<bool>("stateful_displacements") && _fe_problem.isTransient()),
    _volumetric_locking_correction(getParam<bool>("volumetric_locking_correction"))
{
  // Checking for consistency between mesh size and length of the provided displacements vector
  if (_ndisp != _mesh.dimension())
    mooseError("The number of variables supplied in 'displacements' must match the mesh dimension.");

  if (parameters.isParamSetByUser("thermal_expansion_coeff"))
    _no_thermal_eigenstrains = true;

  if (_no_thermal_eigenstrains)
    mooseDeprecated("The calculation of the thermal strains has been moved to the material ComputeThermalExpansionEigenStrains");

  // fetch coupled variables and gradients (as stateful properties if necessary)
  for (unsigned int i = 0; i < _ndisp; ++i)
  {
    _disp[i] = &coupledValue("displacements", i);
    _grad_disp[i] = &coupledGradient("displacements", i);

    if (_stateful_displacements)
      _grad_disp_old[i] = &coupledGradientOld("displacements" ,i);
    else
      _grad_disp_old[i] = &_grad_zero;
  }

  // set unused dimensions to zero
  for (unsigned i = _ndisp; i < 3; ++i)
  {
    _disp[i] = &_zero;
    _grad_disp[i] = &_grad_zero;
    _grad_disp_old[i] = &_grad_zero;
  }
}
Example #29
0
InputParameters validParams<PressureAux>()
{
  InputParameters params = validParams<AuxKernel>();
  params.addRequiredCoupledVar("rhoA", "rhoA");
  params.addRequiredCoupledVar("rhouA_x", "rhouA_x");
  params.addCoupledVar("rhouA_y", "rhouA_y");
  params.addCoupledVar("rhouA_z", "rhouA_z");
  params.addRequiredCoupledVar("rhoEA", "rhoEA");
  params.addRequiredCoupledVar("area", "area");
  params.addRequiredParam<UserObjectName>("eos", "Equation of state");
  return params;
}
InterfaceLogDiffusionElectrons::InterfaceLogDiffusionElectrons(const InputParameters & parameters)
  : InterfaceKernel(parameters),
    _r_units(1. / getParam<Real>("position_units")),
    _r_neighbor_units(1. / getParam<Real>("neighbor_position_units")),

    _diffem(getNeighborMaterialProperty<Real>("diffem")),
    _d_diffem_d_actual_mean_en(getNeighborMaterialProperty<Real>("d_diffem_d_actual_mean_en")),
    _mean_en_neighbor_var(*getVar("mean_en_neighbor", 0)),
    _mean_en_neighbor(_mean_en_neighbor_var.slnNeighbor()),
    _mean_en_neighbor_id(coupled("mean_en_neighbor")),
    _actual_mean_en(0)
{
  if (!parameters.isParamValid("boundary"))
  {
    mooseError("In order to use the InterfaceLogDiffusionElectrons dgkernel, you must specify a "
               "boundary where it will live.");
  }
}