3.4 Globals Section¶
The Globals section is used to define some global variables, such as global constants, solute data and solid bound molecule data, as well user-defined global variables.
Constants¶
Global constants are predefined variables that some modules may rely on and currently include the universal gas constant \(R\) [F\(\cdot\)L/n\(\cdot\)T], absolute temperature \(\theta\) [T], and Faraday constant \(F_{c}\) [Q/n]. These constants must be expressed in units consistent with the rest of the analysis:
<Globals>
<Constants>
<R>8.314e-6</R>
<T>298</T>
<Fc>96485e-9</Fc>
</Constants>
</Globals>
Solutes¶
In biphasic-solute, triphasic, and multiphasic analyses, a unique identifier must be associated with each solute in order to enforce consistent nodal degrees of freedom across boundaries of different materials. This unique identification is achieved by listing each solute species that appears in the entire finite element model and associating it with a unique id, name, and providing its charge number \(z^{\alpha}\), molar mass \(M^{\alpha}\), and density \(\rho^{\alpha}_{T}\):
<Globals>
<Solutes>
<solute id="1" name="Na">
<charge_number>1</charge_number>
<molar_mass>22.99</molar_mass>
<density>0.97</density>
</solute>
<solute id="2" name="Cl">
<charge_number>-1</charge_number>
<molar_mass>35.45</molar_mass>
<density>3.21</density>
</solute>
<solute id="3" name="Glc">
<charge_number>0</charge_number>
<molar_mass>180.16</molar_mass>
<density>1.54</density>
</solute>
</Solutes>
</Globals>
These solute identification numbers should be referenced in the sol attribute of solutes when defining a biphasic-solute (Section General Specification BS Materials), triphasic or multiphasic material (Section General Specification Multiphasic Mat).
The molar mass and density of solutes are needed only when solutes are involved in chemical reactions. When not specified, default values for these properties are set to 1.
Solid-Bound Molecules¶
In multiphasic analyses with chemical reactions involving solid-bound molecules, a unique identifier must be associated with each such molecule in order to enforce consistent properties across the entire model. This unique identification is achieved by listing each solid-bound species that appears in the entire finite element model and associating it with a unique id, name, charge number, molar mass and density:
<Globals>
<SolidBoundMolecules>
<solid_bound id="1" name="CS">
<charge_number>-2</charge_number>
<molar_mass>463.37</molar_mass>
<density>1.5<density>
</solid_bound >
</SolidBoundMolecules >
</Globals>
The id number should be referenced in the sbm attribute of solid-bound molecules when included in the definition of a multiphasic material (Section Triphasic Multiphasic Materials). The charge number is used in the calculation of the fixed charge density contributed by this solid-bound molecule to the overall solid matrix fixed-charge density. The density is used in the calculation of the contribution of this molecule to the referential solid volume fraction. The density and molar mass are used in the calculation of the molar volume of this molecule in chemical reactions.
User Variables¶
Users can define custom, global variables, that can be referenced in other model parameters. This offers a convenient way to parameterize a model. Global user variables can also be used in optimizations. Currently, only scalar values can be defined. User variables are defined in the Variables child element.
To define a global variable, specify the var element, add the name attribute to name the variable, and specify the variable's value as the tag's value.
The following example defines a global variable, called A, and assigns the value 1.23 to it.
<Variables>
<var name="A">1.23</var>
</Variables>
As mentioned, these global variables can be used to define other model variables, for example, in variables that are defined with mathematical expressions. To use a global variable, prefix the name with 'fem.'.
<Material>
<material name="mymat" type="neo-Hookean">
<E type="math">3*fem.A</E>
<v>0.3</v>
</material>
</Globals>