Beispiel #1
0
void
Material::initStatefulProperties(unsigned int n_points)
{
  if (_has_stateful_property)
    for (_qp = 0; _qp < n_points; ++_qp)
      initQpStatefulProperties();
}
Beispiel #2
0
void
PorousFlowJoiner::computeQpProperties()
{
  initQpStatefulProperties();

  _dproperty_dvar[_qp].resize(_num_phases);
  for (unsigned int ph = 0; ph < _num_phases; ++ph)
  {
    _dproperty_dvar[_qp][ph].resize(_num_var);
    for (unsigned v = 0; v < _num_var; ++v)
    {
      // the "if" conditions in the following are because a nodal_material's derivatives might
      // not have been defined.  If that is the case, then DerivativeMaterial passes back a
      // MaterialProperty with zeroes (for the derivatives), but that property will be sized
      // by the number of quadpoints in the element, which may be smaller than the number of
      // nodes!
      _dproperty_dvar[_qp][ph][v] = 0.0;
      if ((*_dphase_property_dp[ph]).size() > _qp)
        _dproperty_dvar[_qp][ph][v] +=
            (*_dphase_property_dp[ph])[_qp] * _dporepressure_dvar[_qp][ph][v];
      if ((*_dphase_property_ds[ph]).size() > _qp)
        _dproperty_dvar[_qp][ph][v] +=
            (*_dphase_property_ds[ph])[_qp] * _dsaturation_dvar[_qp][ph][v];
      if ((*_dphase_property_dt[ph]).size() > _qp)
        _dproperty_dvar[_qp][ph][v] += (*_dphase_property_dt[ph])[_qp] * _dtemperature_dvar[_qp][v];
    }
  }
}
void
PorousFlowPorosityConst::computeQpProperties()
{
  initQpStatefulProperties();

  // The derivatives are zero for all time
  _dporosity_dvar[_qp].assign(_num_var, 0.0);
  _dporosity_dgradvar[_qp].assign(_num_var, RealGradient());
}
Beispiel #4
0
void
PorousFlowJoiner::computeQpProperties()
{
  if (!_include_old)
    initQpStatefulProperties();

  for (unsigned int ph = 0; ph < _num_phases; ++ph)
  {
    _property[_qp][ph] = (*_phase_property[ph])[_qp];
    for (unsigned v = 0; v < _num_var; ++v)
    {
      _dproperty_dvar[_qp][ph][v] = (*_dphase_property_dp[ph])[_qp] * _dporepressure_dvar[_qp][ph][v];
      _dproperty_dvar[_qp][ph][v] += (*_dphase_property_ds[ph])[_qp] * _dsaturation_dvar[_qp][ph][v];
      _dproperty_dvar[_qp][ph][v] += (*_dphase_property_dt[ph])[_qp] * _dtemperature_dvar[_qp][ph][v];
    }
  }
}
Beispiel #5
0
void
Material::initStatefulProperties(unsigned int n_points)
{
  for (_qp = 0; _qp < n_points; ++_qp)
    initQpStatefulProperties();

  // checking for statefulness of properties via this loop is necessary
  // because owned props might have been promoted to stateful by calls to
  // getMaterialProperty[Old/Older] from other objects.  In these cases, this
  // object won't otherwise know that it owns stateful properties.
  for (auto & prop : _supplied_props)
    if (_material_data->getMaterialPropertyStorage().isStatefulProp(prop) &&
        !_overrides_init_stateful_props)
      mooseError(std::string("Material \"") + name() +
                 "\" provides one or more stateful "
                 "properties but initQpStatefulProperties() "
                 "was not overridden in the derived class.");
}