ICs System

Description

The ICs block within an input file is utilized to define the initial (starting) conditions for the variables within your simulation. Initial conditions may be applied to both the "unknowns" (nonlinear or scalar variables) or auxiliary variables. The interface for defining an Initial Condition is to support a function that returns a value at a "Point", and optionally higher order derivatives at that point (e.g. Gradient, Second).

ICs Block

The preferred syntax is to create a top-level "ICs" block with subblocks defining the initial conditions for one or more variables.

[ICs]
  [u_ic]
    type = FunctionIC
    variable = 'u'
    function = parsed_function
  []
[]
(moose/test/tests/ics/function_ic/parsed_function.i)

ICs from an Exodus File

MOOSE contains a shortcut syntax for reading solutions from an Exodus file for the initial condition from right within the Variables. The name of the variable and the time step from which to read the solution must be supplied.

[Variables]
  active = 'u v'

  [u]
    order = FIRST
    family = LAGRANGE
    initial_from_file_var = u
    initial_from_file_timestep = 6
  []

  [v]
    order = FIRST
    family = LAGRANGE
    [InitialCondition]
      type = BoundingBoxIC
      x1 = 0.0
      x2 = 1.0
      y1 = 0.0
      y2 = 1.0
      inside = 3.0
      outside = 1.0
    []
  []
[]
(moose/test/tests/ics/from_exodus_solution/nodal_part2.i)

Initial Condition Coupling

Initial Conditions objects in MOOSE can couple to other variables in the system. When this occurs MOOSE will automatically evaluate dependencies and evaluate initial conditions in an order that supports the valid inspection of variables when computing initial conditions for other variables.

Gradients

Some shape function families support gradient degrees of freedom (Hermite). To properly initialize these DOFs, the initial condition system has an optional override for supplying gradient values.

Inspecting Current Node or Element Pointers

The initial condition system uses a generic projection algorithm for setting the initial condition for each supported discretization scheme. In the general case, the projection system may choose to sample anywhere within the domain and not necessarily right on a mesh node or at an element center position. However, for common FE discretizations such as Lagrange, all of the initial condition samples are taken at nodes. To support these common cases, InitialCondition derived objects have access to pointers to both current nodes and current elements. These will be non-null when samples are taken at the corresponding mesh entity and null otherwise.

Sanity checks on ICs

  • Multiple initial conditions may not be applied to the same variable on the same block

  • Multiple initial conditions may not be applied to the same variable on the same boundary

  • Global initial conditions will conflict with subdomain or boundary restricted ICs on the same variable

Block/Boundary Restrictions

The ICs system support both the BlockRestrictable Interface and BoundaryRestrictable Interface interfaces. When using nodal variables with block restriction, there is an ambiguity that can occur at inter-block interfaces where a node sits in elements of two or more different blocks. To resolve this ambiguity on multi-block nodes, MOOSE chooses the IC object defined on the lowest block ID for a node to "win" along the interface; the winning object's variable must be defined on the block - otherwise the IC for the next lowest block ID for the node is used - and so forth until one has the variable defined.

Available Objects

  • Moose App
  • ArrayConstantICSets constant component values for an array field variable.
  • ArrayFunctionICAn initial condition that uses a normal function of x, y, z to produce values (and optionally gradients) for a field variable.
  • BoundingBoxICBoundingBoxIC allows setting the initial condition of a value inside and outside of a specified box. The box is aligned with the x, y, z axes
  • ConstantICSets a constant field value.
  • FunctionICAn initial condition that uses a normal function of x, y, z to produce values (and optionally gradients) for a field variable.
  • FunctionScalarICInitializes a scalar variable using a function.
  • IntegralPreservingFunctionICFunction initial condition that preserves an integral
  • RandomICInitialize a variable with randomly generated numbers following either a uniform distribution or a user-defined distribution
  • ScalarComponentICInitial condition to set different values on each component of scalar variable.
  • ScalarConstantICInitalize a scalar variable with a constant value prescribed by an input parameter.
  • ScalarSolutionICSets the initial condition from a scalar variable stored in an Exodus file, retrieved by a SolutionUserObject
  • ScalarSolutionInitialConditionSets the initial condition from a scalar variable stored in an Exodus file, retrieved by a SolutionUserObject
  • SolutionICSets the initial condition from a field variable stored in an Exodus file, retrieved by a SolutionUserObject
  • SolutionInitialConditionSets the initial condition from a field variable stored in an Exodus file, retrieved by a SolutionUserObject
  • VectorConstantICSets constant component values for a vector field variable.
  • VectorFunctionICSets component values for a vector field variable based on a vector function.

Available Actions