Add flexibility to Elmer with MATC

Add flexibility to Elmer with MATC

One of the main advantage that offers an open-source software is the possibility to modify the code and to adapt it to your needs. However, you may not have the time or knowledge to do it.

MATC is a library for the evaluation of mathematical expressions on the fly from the Elmer command file.

For example, let say you want to calculate the saturation vapor pressure of water (Pw), that depends on temperature. Then, you want to prescribe a heat flux on a boundary, that is function of Pw as well as other variables. You first define new variables in the solver, then create body forces to evaluate your state variables at each iteration:

#  IDRA SIMULATION- Extract of Elmer command file

Solver 1
 Exported Variable 1 = Pw 
 Exported Variable 2 = lh 
 Exported Variable 3 = Pa
 Exported Variable 4 = Tdp

 Update Exported Variables = Logical True
 Nonlinear Update Exported Variables = Logical True

Body Force 2
   Pw = Variable Temperature; Real MATC '(exp(77.3450+0.0057*tx(0)-7235/tx(0))/tx(0)^8.2/133.32239)';

Boundary Condition 2
   Target Boundaries(1) = 14
   Heat Flux BC = Logical True
   Heat Flux = Variable Pw,lh,Timestep size; Real MATC ;'-tx(0)*tx(1)*1000.0/(vfilm*tx(2)*tx(2))';

Possibilities are endless. For example, this proof of concept simulation (on a coarse mesh) calculating the concentration of water vapor from a user-specific function:

For training or consulting using Elmer, contact us.