MoDeNa-EUProject / MoDeNa

Software Framework for MOdelling of morphology DEvelopment of micro- and NAnostructures (MoDeNa)
17 stars 19 forks source link

implement model chaining for models created with index sets #44

Closed japaf closed 8 years ago

japaf commented 8 years ago

It currently doesn't work. A test case is on my fork on branch "aging". Test case works likes this: We have 3 gasConductivity models created with index sets for 3 species. Input is only temperature. Next, we have gasMixtureConductivity model with 7 inputs: temperature, 3 molar fractions, 3 species conductivity. Finally, we have macroscopic application, which wants to call gasMixtureConductivity model with 4 inputs: temperature, 3 molar fractions.

Test case can be run by going to applications/PUfoam/foamAging and executing: ./gasmix (initialization) and ./workflow.

The output looks like:

   1.7249999999999998E-002
   2.5830000000000002E-002
   1.3790000000000000E-002
temp = 300
x = 1, 0, 0
k = 5.53354e-322, 3.87842e-321, 0.01379
   5.5335352334219613E-322

The first three numbers are species conductivities printed from macroscopic application. Next three lines are printed directly from C-code of the surrogate function for gasMixtureConductivity. Last number is gas mixture conductivity as seen from macroscopic application. The line k = ... should give the same numbers as the first three numbers. However, only one of the models is chained.

Definition of the surrogate model can be found in applications/PUfoam/Models/gasMixtureConductivity/gasMixtureConductivity.py.

japaf commented 8 years ago

The issue may not be connected to index sets. The same behaviour is observed when model has more than one substitute models. The substitute models don't have to be created with index sets.

henrus commented 8 years ago

Hi Pavel, I tried to reproduce this issue with 7b880e83

Unfortunately, I am getting ...

zip ---

Performing backward mapping simulation (macroscopic code recipe)

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

0 0x2B4A4C5D8777

1 0x2B4A4C5D8D7E

2 0x2B4A4CE2BD3F

3 0x2B4A4C3BB056

4 0x4294EC in **physicalproperties_MOD_createmodels

5 0x45371B in MAIN** at main.f90:?

Segmentation fault

zip ---

I also tried examples/twoTanksChained - it fails. Working on it.

Let's discuss this later today.

henrus commented 8 years ago

This should be fixed in 580a2b from substituteModels2.

japaf commented 8 years ago

It works for me, so I think we can close it.