www.mooseframework.org
DiscreteNucleationAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "DiscreteNucleationAux.h"
11 #include "DiscreteNucleationMap.h"
12 
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<AuxKernel>();
20  params.addClassDescription("Project the DiscreteNucleationMap state onto an AuxVariable");
21  params.addRequiredParam<UserObjectName>("map", "DiscreteNucleationMap user object");
22  params.addParam<Real>("no_nucleus_value", 0.0, "Variable value indicating no nucleus is present");
23  params.addParam<Real>(
24  "nucleus_value", 1.0, "Variable value indicating the presence of a nucleus");
25  return params;
26 }
27 
28 DiscreteNucleationAux::DiscreteNucleationAux(const InputParameters & params)
29  : AuxKernel(params),
30  _map(getUserObject<DiscreteNucleationMap>("map")),
31  _v0(getParam<Real>("no_nucleus_value")),
32  _v1(getParam<Real>("nucleus_value"))
33 {
34  if (isNodal())
35  paramError("variable", "This kernel must operate on an elemental AuxVariable.");
36 }
37 
38 void
40 {
41  // check if a nucleation event list is available for the current element
42  _nucleus = &_map.nuclei(_current_elem);
43 }
44 
45 Real
47 {
48  return (*_nucleus)[_qp] * (_v1 - _v0) + _v0;
49 }
DiscreteNucleationMap
This UserObject maintains a per QP map that indicates if a nucleus is present or not.
Definition: DiscreteNucleationMap.h:25
DiscreteNucleationAux::_v1
const Real _v1
Definition: DiscreteNucleationAux.h:41
DiscreteNucleationAux
Project the DiscreteNucleationMap onto an AuxVariable field.
Definition: DiscreteNucleationAux.h:24
DiscreteNucleationMap.h
DiscreteNucleationAux.h
DiscreteNucleationAux::_v0
const Real _v0
Bounds for the returned values.
Definition: DiscreteNucleationAux.h:40
DiscreteNucleationAux::precalculateValue
void precalculateValue() override
Definition: DiscreteNucleationAux.C:39
validParams< DiscreteNucleationAux >
InputParameters validParams< DiscreteNucleationAux >()
Definition: DiscreteNucleationAux.C:17
DiscreteNucleationAux::_map
const DiscreteNucleationMap & _map
UserObject providing a map of currently active nuclei.
Definition: DiscreteNucleationAux.h:34
DiscreteNucleationMap::nuclei
const std::vector< Real > & nuclei(const Elem *) const
Definition: DiscreteNucleationMap.C:128
DiscreteNucleationAux::computeValue
Real computeValue() override
Definition: DiscreteNucleationAux.C:46
DiscreteNucleationAux::DiscreteNucleationAux
DiscreteNucleationAux(const InputParameters &params)
Definition: DiscreteNucleationAux.C:28
DiscreteNucleationAux::_nucleus
const std::vector< Real > * _nucleus
nucleus data for the current element
Definition: DiscreteNucleationAux.h:37
registerMooseObject
registerMooseObject("PhaseFieldApp", DiscreteNucleationAux)