implement model chaining for models created with index sets
Closed this issue · 4 comments
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
.
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.
Hi Pavel,
I tried to reproduce this issue with 7b880e8
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.
This should be fixed in 580a2b from substituteModels2.
It works for me, so I think we can close it.