MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
SurfaceTension.SurfaceTension Namespace Reference

Surrogate Function, Surrogate Model templates and Model Recipe. More...

Data Structures

class  SurfaceTensionExactSim
 Recipe for PCSAFT Surface Tension Application. More...
 

Variables

 blowing_agents
 (MoDeNa) Index Set for the Blowing Agents that are valid for the model More...
 
 monomers
 (MoDeNa) Index Set for the Monomers that are valid for the model More...
 
 surfactant
 (MoDeNa) Index Set for the Surfactants that are valid for the model More...
 
 f
 (MoDeNa) Surrogate Function Template More...
 
 m
 (MoDeNa) Surrogate Model Template (Air, THF) More...
 
 m2
 (MoDeNa) Surrogate Model Template (Air, PU) More...
 

Detailed Description

Surrogate Function, Surrogate Model templates and Model Recipe.

Author
Jonas Mairhofer

Surface Tension python module.

Contains the following:

The FireTask which controls the call of the detailed model. This detailed model is called at the very beginning of the simulation in order to generate initial data points which can be used to fit the parameters of the surrogate model and during a running simulation as soon as the Surface Tension model is called with input parameters which lie outside the range the parameters of the surrogate model was so far fitted for. This FireTask is stored in the class "SurfaceTensionExactSim" and a more detailed description of the detailed model can be found in the description of this class.

Furthermore, this module contains the code of the surrogate model function as well as the definitions of its input and output values and its fittable parameters. Care should be taken to set reasonable bounds for these variables.

Also, this module contains the backward mapping model. This model consits of the surrogate model function, an initialisation strategy, the out of bounds strategy and the parameter fitting strategy. The initialisation strategy defines the initial data points where the detailed model will be evaluated at simulation start for an initial fit of the surrogate model parameters. The out of bounds strategy determines, how many new points and where to place these new points, once the Surface Tension model is called for input values outside of the fitted range. The parameter fitting strategy defines tolerances and maximal iterations which are passed to the numerical solver which performs the actual fitting of the surrogate model parameters.

Variable Documentation

◆ blowing_agents

SurfaceTension.SurfaceTension.blowing_agents
Initial value:
1 = IndexSet(
2  name= 'blowing_agents',
3  names= [ 'AIR', 'CO2']
4 )

(MoDeNa) Index Set for the Blowing Agents that are valid for the model

The index set contains two elements:

\[ \mathbb{A} = \left\{ \text{Air}, \text{CO2} \right\} \]

Definition at line 84 of file SurfaceTension.py.

◆ f

SurfaceTension.SurfaceTension.f
Initial value:
1 = CFunction(
2  Ccode= ,
3  inputs={
4  'T': { 'min': 270.0, 'max': 550.0 },
5  },
6  outputs={
7  'ST': { 'min': 9e99, 'max': -9e99, 'argPos': 0 },
8  },
9  parameters={
10  'param0': { 'min': -1E10, 'max': 1E10, 'argPos': 0 },
11  'param1': { 'min': -1E10, 'max': 1E10, 'argPos': 1 },
12  'param2': { 'min': -1E10, 'max': 1E10, 'argPos': 2 },
13  },
14  species = {
15  'A' : blowing_agents,
16  'B' : monomers,
17  'C' : surfactant,
18  }
19 )

(MoDeNa) Surrogate Function Template

The surrogate function is an indexed function of the form:

\[ \hat{\mathcal{M}} := f_{A,B,C}(T; \theta_1, \theta_2, \theta_3) \quad;\quad 270 \leq T \leq 550 \quad A\in\mathbb{A} \quad B\in \mathbb{B} \quad C\in \mathbb{C} \]

Where \(\mathbb{A}\) and \(\mathbb{B}\) respectively are the index sets blowing_agents and monomers.

\[ f_{A,B}(T; \theta_1, \theta_2, \theta_3) := \theta_1 \cdot T + \theta_2 \cdot T^2 + \theta_3 \cdot T^3 \]

Attention
Look here
Precondition
Note
Todo:
Check if parameter bounds are reasonable
Warning

Definition at line 227 of file SurfaceTension.py.

◆ m

SurfaceTension.SurfaceTension.m
Initial value:
1 = BackwardMappingModel(
2  _id= 'SurfaceTension[A=AIR,B=PU,C=surfactant]',
3  surrogateFunction= f,
4  exactTask= SurfaceTensionExactSim(),
5  substituteModels= [ ],
6  initialisationStrategy= Strategy.InitialPoints(
7  initialPoints=
8  {
9  'T': [290.0, 300.0, 350.0, 500.0],
10  },
11  ),
12  outOfBoundsStrategy= Strategy.ExtendSpaceStochasticSampling(
13  nNewPoints= 4
14  ),
15  parameterFittingStrategy= Strategy.NonLinFitWithErrorContol(
16  testDataPercentage= 0.2,
17  maxError= 1e-0,
18  improveErrorStrategy= Strategy.StochasticSampling(
19  nNewPoints= 2
20  ),
21  maxIterations= 5 # Currently not used
22  ),
23 )

(MoDeNa) Surrogate Model Template (Air, THF)

The surrogate model is defined for the indices "Air" and "THF":

\[ \hat{\mathcal{M}} := f_{\text{Air},\text{THF},\text{surfactant}}( T; \theta_1, \theta_2, \theta_3) \]

Attention
Look here
Precondition
Note
Todo:
Warning
Bug:

Definition at line 282 of file SurfaceTension.py.

◆ m2

SurfaceTension.SurfaceTension.m2
Initial value:
1 = BackwardMappingModel(
2  _id= 'SurfaceTension[A=AIR,B=PU,C=no_surfactant]',
3  surrogateFunction= f,
4  exactTask= SurfaceTensionExactSim(),
5  substituteModels= [ ],
6  initialisationStrategy= Strategy.InitialPoints(
7  initialPoints=
8  {
9  'T': [290.0, 300.0, 350.0, 500.0],
10  },
11  ),
12  outOfBoundsStrategy= Strategy.ExtendSpaceStochasticSampling(
13  nNewPoints= 4
14  ),
15  parameterFittingStrategy= Strategy.NonLinFitWithErrorContol(
16  testDataPercentage= 0.2,
17  maxError= 1e-0,
18  improveErrorStrategy= Strategy.StochasticSampling(
19  nNewPoints= 2
20  ),
21  maxIterations= 5 # Currently not used
22  ),
23 )

(MoDeNa) Surrogate Model Template (Air, PU)

\[ \hat{\mathcal{M}} := f_{\text{Air},\text{PU},\text{no\_surfactant}}( T; \theta_1, \theta_2, \theta_3) \]

Note
Todo:
Warning
Bug:

Definition at line 319 of file SurfaceTension.py.

Referenced by WrightCorrection().

◆ monomers

SurfaceTension.SurfaceTension.monomers
Initial value:
1 = IndexSet(
2  name = 'monomers',
3  names = ['PU', 'THF', 'HEXANE']
4 )

(MoDeNa) Index Set for the Monomers that are valid for the model

The index set contains four elements:

\[ \mathbb{B} = \left\{ \text{PU}, \text{THF}, \text{HEXANE} \right\} \]

Definition at line 99 of file SurfaceTension.py.

◆ surfactant

SurfaceTension.SurfaceTension.surfactant
Initial value:
1 = IndexSet(
2  name = 'surfactant',
3  names = ['surfactant','no_surfactant']
4 )

(MoDeNa) Index Set for the Surfactants that are valid for the model

The index set contains four elements:

\[ \mathbb{C}= \left\{ \text{surfactant}, \text{no\_surfactant} \right\} \]

Definition at line 114 of file SurfaceTension.py.