Applying a Volumetric Mixture Source to a Simulation

The volumetric mixture source determines how much of each species is present in a multispecies flow analysis. You can specify each species by concentration of material per unit volume or in terms of total mass. In addition, you can specify species values that are uniform throughout space, vary in space according to a mapped spatial field, or vary according to the values in a Javascript user subroutine.

See Also
About Volumetric Mixture Sources
  1. From the Loads section of the action bar, click Volumetric Mixture Source .
  2. Optional: Enter a descriptive Name.
  3. Select the geometry supports in the model to which you want to add the volumetric mixture source.
  4. Specify whether the volumetric mixture source data defines species in terms of total mass or concentration per unit volume.
  5. Specify how you want to define each species:
    OptionDescription
    Uniform Defines the species concentration or mass with a single value that is constant throughout space.
    Mapped spatial data Defines the species concentration or mass with values that vary in space according to a mapped data field. For more information about defining values that vary according to mapped data, see Mapping Data File Formats.
    User-defined Defines the species concentration or mass with values specified by a user subroutine. For more information about defining values that vary according to mapped data, see Applying JavaScript User Subroutines.
  6. Optional: For each species, click , then specify a scale factor or an amplitude to change the magnitude of the species values or adjust them in time according to the amplitude profile.
  7. Click OK.

User Subroutines

The following user subroutine defines a species term that varies as a function of coordinate and time:

coord = support.getVector('COORD', CenteringType.ELEMENT

for (var i = 0; i < this.values.length; i++) {
  x = coord[i][0];
  if (x<0.102 && x>0.098 && timeParameters.time < 10){
    this.values[i] = 100.0 ;
  }
  else{
    this.values[i] = 1.0 ;
  }
}

The following user subroutine defines a species term that varies as a function of mass fraction:

var massFraction = support.getSpecies("CMF", CenteringType.ELEMENT, "Test_drug");
var scale = -1000;
for (var i=0; i<this.values.length; i++){
  this.values[i] = scale*massFraction[i]; 
}