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

Surrogate model and Firetasks for Foam conductivity model. More...

Data Structures

class  FoamConductivityExactTask
 Recipe for Foam conductivity application. More...
 

Variables

 FLOAT_REPR
 adjust precision of floats when saving json files
 
 f_foamConductivity
 Surrogate function for thermal conductivity of the foam. More...
 
 foaming_ini = json.load(fl)
 
 m_foamConductivity
 Surrogate model for foam conductivity. More...
 
 m_simulation
 Foam conductivity simulation. More...
 

Detailed Description

Surrogate model and Firetasks for Foam conductivity model.

Author
Pavel Ferkl

Foam conductivity python module

Contains a FireTask, which runs the detailed model and copies the results into the results folder. The relative path and name of the detailed model executable are hard coded. The FireTask is BackwardMapping, which means that if one of the lower scale backward mapping models will get out of validity range that model will be re-fitted to larger range and the detailed model will be re-run. This is repeated until the detailed model succesfully finishes (or possibly crashes for other reason, in which case an error is printed out).

Also contains a definition of surrogate function and surrogate model. The surrogate model is Backward mapping. Thus, it can be automatically re-fitted using the prepared ExactTask, which executes the detailed model, reads the results and stores them in the database.

Variable Documentation

◆ f_foamConductivity

foamConductivity.foamConductivity.f_foamConductivity
Initial value:
1 = CFunction(
2  Ccode=,
3  # These are global bounds for the function
4  inputs={
5  'eps': {'min': 0, 'max': 0.995},
6  'dcell': {'min': 0, 'max': 1e-1},
7  'fstrut': {'min': 0, 'max': 1},
8  'gasMixtureConductivity': {'min': 0, 'max': 1e-1},
9  'polymer_thermal_conductivity': {'min': 0, 'max': 1e0},
10  'T': {'min': 273, 'max': 550},
11  'x': {'index': gasConductivity.species, 'min': 0, 'max': 1},
12  },
13  outputs={
14  'kfoam': {'min': 0, 'max': 1e0, 'argPos': 0},
15  },
16  parameters={
17  'param1': {'min': -1e9, 'max': 1e9 + 2, 'argPos': 0},
18  'param2': {'min': -1e9, 'max': 1e9 + 2, 'argPos': 1},
19  },
20 )

Surrogate function for thermal conductivity of the foam.

Foam conductivity is a function of porosity, cell size, strut content, conductivity of gas and solid phase and temperature.

Definition at line 161 of file foamConductivity.py.

◆ m_foamConductivity

foamConductivity.foamConductivity.m_foamConductivity
Initial value:
1 = BackwardMappingModel(
2  _id='foamConductivity',
3  surrogateFunction=f_foamConductivity,
4  exactTask=FoamConductivityExactTask(),
5  substituteModels=[
6  gasMixtureConductivity.m_gasMixtureConductivity,\
7  polymerConductivity.m_polymer_thermal_conductivity\
8  ],
9  initialisationStrategy=Strategy.InitialPoints(
10  initialPoints=foaming_ini,
11  ),
12  outOfBoundsStrategy=Strategy.ExtendSpaceStochasticSampling(
13  nNewPoints=4
14  ),
15  parameterFittingStrategy=Strategy.NonLinFitWithErrorContol(
16  testDataPercentage=0.2,
17  maxError=0.01,
18  improveErrorStrategy=Strategy.StochasticSampling(
19  nNewPoints=2
20  ),
21  maxIterations=5 # Currently not used
22  ),
23 )

Surrogate model for foam conductivity.

Backward mapping model is used. Gas and polymer conductivity are taken from substitute models.

Definition at line 226 of file foamConductivity.py.

◆ m_simulation

foamConductivity.foamConductivity.m_simulation
Initial value:
1 = Strategy.BackwardMappingScriptTask(
2  script=os.path.dirname(os.path.abspath(__file__))+'/src/kfoam' +
3  ' && cp foamConductivity.out ../results/foamConductivity' +
4  ' && cp hahtf.out ../results/foamConductivity'
5 )

Foam conductivity simulation.

Runs the detailed model and saves the results. For the case, when only foam conductivity and no aging is needed.

Definition at line 254 of file foamConductivity.py.