How to read multiphase parameters in creatFields from Transportproperties ?
Hi,
I wrote a new code for Compressible LcmFoam which actually is improved version of LcmFoam for compressible flows. But i have an issue with my phases and parameters , if i give my parameters in creatFields , everything is fine and the solver works properly, but i want to read the parameters from my Transportproperties for multi-phase parameters. So the question is: I only have 2 of my parameters from Transportproperties (rho1 , rho2) but i need in my createFields to read the other parameters as well, such as (nu1, nu2) and speed of sound (C_Sound) and etc. can anyone help me what would be the command for that ? My Transportproperties would be the following: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // phases (resin air); resin { transportModel Newtonian; nu [0 2 -1 0 0 0 0] 297e-7; rho [1 -3 0 0 0 0 0] 1110; } air { transportModel Newtonian; nu [0 2 -1 0 0 0 0] 14.5e-06; rho [1 -3 0 0 0 0 0] 1; } sigma [1 0 -2 0 0 0 0] 0.0; // ************************************************** *********************** // With best regards Amirhossein |
Hi,
your task requires the generation of an IOdictionary. After you build that object with the correct values, you can access the file and read out different data. Please check out Doxygen while searching IOdictionary |
Dear Tobi,
Thanks for the help. I tried to look it up and search it. I found a way to do it as following code in my createFields: Code:
IOdictionary transportProperties Quote:
as you see i already defined nu in my transportProperties as well. i try to find "nu" first and then if it works other parameters. With best regards Amirhossein |
Hi,
no you did not define nu in your file as you should. You defined it within the subdictionary. The code is not smart enough to do it for you. You have to access the subdict first and then nu is found. Otherwise you have to define nu outside the subdicts. |
Thanks a lot Tobi,
I have done it with your help and my advisor's help. For those who wants to do it call something from transportProperties in their createFields, I will put that part of my createFields here , i hope it helps others as well. creatheFields: Code:
IOdictionary transportProperties transportProperties: Code:
/*--------------------------------*- C++ -*----------------------------------*\ |
All times are GMT -4. The time now is 23:04. |