<commit_before>#ifndef PRECURSORACTION_H
#define PRECURSORACTION_H

#include "VariableNotAMooseObjectAction.h"

/**
 * This Action adds all required delayed neutron precursor variables and
 * kernels to the problem. Since the delayed neutron precursors transport
 * problem is pure advection, the problem is solved using discontinous Galerkin
 * as documented in:
 * <a href="http://epubs.siam.org/doi/book/10.1137/1.9780898717440">
 * Discontinuous Galerkin Methods for Solving Elliptic and Parabolic
 * Equations: Theory and Implementation
 * </a>
 * Note that the flow velocity must be constant when using the DGAdvection
 * or DGTemperatureAdvection. In order to vary to flow through a user-defined
 * function, use DGFunctionAdvection or DGFunctionTemperatureAdvection.
 */
class PrecursorAction : public VariableNotAMooseObjectAction
{
public:
  PrecursorAction(const InputParameters & params);

  void act() override;

  using Action::addRelationshipManagers;
  void addRelationshipManagers(Moose::RelationshipManagerType when_type) override;

protected:
  /// Adds PrecursorSource kernel
  void addPrecursorSource(const unsigned & op, const std::string & var_name);
  /// Adds PrecursorDecay kernel
  void addPrecursorDecay(const unsigned & op, const std::string & var_name);
  /// Adds ScalarTransportTimeDerivative kernel
  void addTimeDerivative(const std::string & var_name);
  /// Adds DGAdvection kernel
  void addDGAdvection(const std::string & var_name);
  /// Adds appropriate outflow BC depending on velocity type
  void addOutflowBC(const std::string & var_name);
  /// Adds appropriate inflow BC depending on velocity type
  void addInflowBC(const std::string & var_name);
  /// Adds random initial conditions for Jacobian testing
  void addInitialConditions(const std::string & var_name);
  /// Adds postprocessors to calculate flow-weighted precursor conc at outlet
  void addOutletPostprocessor(const std::string & var_name);
  /// Adds Receiver postprocessor required for precursor conc at inlet
  void addInletPostprocessor(const std::string & var_name);
  /// Adds MultiAppTransfers to simulate precursor looped flow by exchanging inlet/outlet data
  void addMultiAppTransfer(const std::string & var_name);
  /// Adds postprocessor to calculate coolant outflow rate required by addOutletPostprocessor
  void addCoolantOutflowPostprocessor();
  /// Sets variable and block params. Used to reduce repeating code
  void setVarNameAndBlock(InputParameters & params, const std::string & var_name);

  /// number of precursor groups
  unsigned int _num_precursor_groups;

  /// base name for neutron variables
  std::string _var_name_base;

  /// number of energy groups<commit_msg>Convert to full function docstrings<commit_after>#ifndef PRECURSORACTION_H
#define PRECURSORACTION_H

#include "VariableNotAMooseObjectAction.h"

/**
 * This Action adds all required delayed neutron precursor variables and
 * kernels to the problem. Since the delayed neutron precursors transport
 * problem is pure advection, the problem is solved using discontinous Galerkin
 * as documented in:
 * <a href="http://epubs.siam.org/doi/book/10.1137/1.9780898717440">
 * Discontinuous Galerkin Methods for Solving Elliptic and Parabolic
 * Equations: Theory and Implementation
 * </a>
 * Note that the flow velocity must be constant when using the DGAdvection
 * or DGTemperatureAdvection. In order to vary to flow through a user-defined
 * function, use DGFunctionAdvection or DGFunctionTemperatureAdvection.
 */
class PrecursorAction : public VariableNotAMooseObjectAction
{
public:
  PrecursorAction(const InputParameters & params);

  void act() override;

  using Action::addRelationshipManagers;
  void addRelationshipManagers(Moose::RelationshipManagerType when_type) override;

protected:

  /**
  * Adds PrecursorSource kernel
  *
  * @param op The zero-based index for the precursor group the kernel acts on
  * @param var_name The name of the variable the kernel acts on
  */
  void addPrecursorSource(const unsigned & op, const std::string & var_name);

  /**
  * Adds PrecursorDecay kernel
  *
  * @param op The zero-based index for the precursor group the kernel acts on
  * @param var_name The name of the variable the kernel acts on
  */
  void addPrecursorDecay(const unsigned & op, const std::string & var_name);

  /**
  * Adds ScalarTransportTimeDerivative kernel
  *
  * @param var_name The name of the variable the kernel acts on
  */
  void addTimeDerivative(const std::string & var_name);

  /**
  * Adds DGAdvection kernel
  *
  * @param var_name The name of the variable the kernel acts on
  */
  void addDGAdvection(const std::string & var_name);

  /**
  * Adds appropriate outflow BC depending on velocity type
  *
  * @param var_name The name of the variable the BC acts on
  */
  void addOutflowBC(const std::string & var_name);

  /**
  * Adds appropriate inflow BC depending on velocity type
  *
  * @param var_name The name of the variable the BC acts on
  */
  void addInflowBC(const std::string & var_name);

  /**
  * Adds random initial conditions for Jacobian testing
  *
  * @param var_name The name of the variable the IC acts on
  */
  void addInitialConditions(const std::string & var_name);

  /**
  * Adds postprocessors to calculate flow-weighted precursor conc at outlet
  *
  * @param var_name The name of the variable the postprocessor acts on
  */
  void addOutletPostprocessor(const std::string & var_name);

  /**
  * Adds Receiver postprocessor required for precursor conc at inlet
  *
  * @param var_name The name of the variable the postprocessor acts on
  */
  void addInletPostprocessor(const std::string & var_name);

  /**
  * Adds MultiAppTransfers to simulate precursor looped flow by exchanging inlet/outlet data
  *
  * @param var_name The name of the variable the MultiAppTransfers acts on
  */
  void addMultiAppTransfer(const std::string & var_name);

  /**
  * Adds postprocessor to calculate coolant outflow rate required by addOutletPostprocessor
  *
  * @param var_name The name of the variable the postprocessor acts on
  */
  void addCoolantOutflowPostprocessor();

  /**
  * Sets variable and block params. Used to reduce repeating code
  *
  * @param params The InputParameters in which to set variable and block params
  * @param var_name The name of the variable the postprocessor acts on
  */
  void setVarNameAndBlock(InputParameters & params, const std::string & var_name);

  /// number of precursor groups
  unsigned int _num_precursor_groups;

  /// base name for neutron variables
  std::string _var_name_base;

  /// number of energy groups
{'fraction_non_alphanumeric': 0.07184905660377358, 'fraction_numerical': 0.0060377358490566035, 'mean_word_length': 4.36084142394822, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6417772', 'n_tokens_mistral': 1944, 'n_tokens_neox': 1831, 'n_words': 687}