simphony / simphony-openfoam

The implementation of the SimPhoNy OpenFOAM -wrappers.
GNU General Public License v2.0
2 stars 0 forks source link

Multiphase cases fail: wrong enteries in the transportProperties OF dictionary. #21

Closed ahashibon closed 9 years ago

ahashibon commented 9 years ago
>python poiseuille_vof.py
Mesh name  poiseuille_vof

Default patch type set to empty 
Case directory  /tmp/tmpsaoY2V/poiseuille_vof
Simulation run up to time:  0
Closing remaining open files:poiseuille_vof/poiseuille_vof.cuds...done

iteration 0! can't be right....the openfoam222 log file:

--> FOAM FATAL IO ERROR: 
invalid first character found : '

file: /tmp/tmpsaoY2V/poiseuille_vof/constant/transportProperties at line 35.

From function ISstream::read(word&)
in file db/IOstreams/Sstreams/ISstream.C at line 473.

FOAM exiting

-- This is due to an inconsistent naming of the phases in the trasnportproperties file, instead of the simple implicit form in the template

sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07;

PyFoam produces (by the ParsedParameterFile) the following line:

sigma sigma     [ 1 0 -2 0 0 0 0 ] {
      ('water', 'air') 0.07286;
   } ;

the error above means that the ' quotes should be removed. But after that we still get an error since this is the first time water or air phase names is mentioned, and since OF still expects the old one line format above.

adding the line phases (water air); to the transportproperties template helps, but then the alpha field needs to have a different naming under 0/:

--> FOAM FATAL IO ERROR: cannot find file

file: /tmp/tmpsaoY2V/poiseuille_vof/0/alphawater at line 0.

 From function regIOobject::readStream()
 in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting

but by now, the alphawater naming is obsolete!

Since, this is basically related to the change in the way phases are represented in OF (which changes from OF 2.0 to 2.1.0, 2.2.2, and now 2.3.1 seems to have stabilzed). Perhaps a solution would be to move to OF231 with the much improved (and stable) phase naming. It is also more consistent with SimPhoNy phase list naming, see here: http://www.openfoam.org/version2.3.0/multiphase.php

khiltunen commented 9 years ago

The wrapper was not updated to new syntax. Earlier in the examples there was only one surface tension and one could say in the code that: wrapper.SP_extensions[CUBAExt.SURFACE_TENSION] = 72.86e-3

This will be fixed asap to obey syntax

wrapper.SP_extensions[CUBAExt.SURFACE_TENSION] = {('water', 'air'): 72.86e-3}