4.9.4. Source terms

Source terms for the different activated equations can be set in a few different ways - external sources, subroutine or function sources, and point sources. All of these are specified in the Solution Options block.

4.9.4.1. External Sources

External sources are activated with the Use External ... commands below. This will create a nodal source field (e.g. energy_source) and it is expected that the relevant source values will be transferred into that field from an external region.

Begin Solution Options

  Use External Continuity Source
  Use External Energy Source
  Use External Mixture_Fraction Source
  Use External Momentum Source
  Use External Soot_Mass_Fraction Source
  Use External Species Source

4.9.4.2. Subroutines and String Functions

User subroutines can be defined and used as sources using the following command

Begin Solution Options

  #Source term subroutine = NAME_OF_SUB for equation NAME_OF_EQ [NAME_OF_VAR]
  Source term subroutine = my_enth_src for equation Enthalpy
  Source term subroutine = my_pv_src for equation Progress_Variable my_var
  Source term subroutine = my_methane_src for equation Species CH4

Similarly, user-defined string functions can be used to define custom source terms

Begin Solution Options

  #Source term function = "fcn_content" for equation NAME_OF_EQ [NAME_OF_VAR]
  SOURCE TERM FUNCTION = "x+0*y_velocity" FOR EQUATION X_Momentum
  SOURCE TERM FUNCTION = "-10*pv_test" FOR EQUATION progress_variable pv_test
  SOURCE TERM FUNCTION = "point2d(x-1.2, y+0.3, 0.01, 0.02)*1e-3" FOR EQUATION Species CH4

The string functions can include time and coordinates (t, x, y, z) and any nodal variables.

4.9.4.3. Point Sources

Point sources are designed to inject fluid at a given point with specified properties. Each point source requires a location, Mdot, and relevant primitive variables to inject.

Begin Solution Options

  Begin Point Source InjectionA
    Location = sphere at 1.2 -0.3 0 radius = 0.05
    Mdot = "3e-5 + 1e-4*t"      # kg/s
    temperature = 450
    mass_fraction N2A = 0.0
    mass_fraction N2B = 1.0
    mass_fraction N2C = 0.0
    turbulent_kinetic_energy = 1e-2
  End

The Location can be either sphere at x y z radius = R or node nearest x y z. If the sphere is used, the source is applied evenly on all nodes inside the specified sphere. If there are no nodes inside the specified sphere, the nearest node is used.

If mesh motion is active, the nodes where the source is applied will be selected only once, using the initial mesh coordinates, so the source will move with the mesh.

The complete list of commands for the point source can be found in Point Source.