Difference between revisions of "How to add transport of N solutes to icoFoam"

From OpenFOAMWiki
(Container class solute)
Line 2: Line 2:
  
 
== Container class ''solute'' ==
 
== Container class ''solute'' ==
 +
The solute list containing [http://en.wikipedia.org/wiki/Fick's_laws_of_diffusion Fick's Law] diffusion coefficients is defined in
 +
case/constant/solutionProperties
 +
 +
Check the example below
 +
<cpp>sugar
 +
{
 +
    diffusionModel  constant;
 +
    D          D          [0 2 -1 0 0 0 0] 5.2e-10;
 +
}
 +
   
 +
ethanol
 +
{
 +
    diffusionModel  constant;
 +
    D          D          [0 2 -1 0 0 0 0] 1.6e-9;
 +
}
 +
 +
N2
 +
{
 +
    diffusionModel  constant;
 +
    D          D          [0 2 -1 0 0 0 0] 3.6e-9;
 +
}
 +
</cpp>
 +
 +
Let's work a bit with class inheritance to create a container class for each solute
 +
 +
 +
== Files ==
 +
Source files and example case:

Revision as of 18:41, 16 September 2012

Before reading this tutorial, you should first understand how to add temperature to icoFoam. The idea here is the analogous, but in the case of solutions one can have an indefinite number of solutes dissolved in a solvent. The dissolution of different phases is not modelled here, therefore solute concentrations may not increase above solubility saturation (under saturation hypothesis).

1 Container class solute

The solute list containing Fick's Law diffusion coefficients is defined in

case/constant/solutionProperties

Check the example below

sugar
{
    diffusionModel  constant;
    D           D           [0 2 -1 0 0 0 0] 5.2e-10;
}
    
ethanol
{
    diffusionModel  constant;
    D           D           [0 2 -1 0 0 0 0] 1.6e-9;
}
 
N2
{
    diffusionModel  constant;
    D           D           [0 2 -1 0 0 0 0] 3.6e-9;
}

Let's work a bit with class inheritance to create a container class for each solute


2 Files

Source files and example case: