CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   reading nu for multiphase flows (http://www.cfd-online.com/Forums/openfoam-programming-development/92592-reading-nu-multiphase-flows.html)

lindstroem September 19, 2011 11:00

reading nu for multiphase flows
 
Hi everybody,

I want to extend a solver from single to multiphase flows. At one point I am stuck because of the reading of the transportPropterties.

The "old" code says:
Code:

dimensionedScalar nu(transportProperties.lookup("nu"));
If I get it right, I will have a nu1 and nu2 for multiphase flows. Can I only access them via createFields or can it be read by transportProperties...?

Thanks for your help!
Lindstroem

marupio September 19, 2011 15:50

createFields reads from transportProperties. If you want nu1 and nu2 defined, you need to modify your solver - and why not change createFields?

lindstroem September 20, 2011 03:51

Hi David,

thanks for your suggestion. Actually I need them in a function where I calculate some forces (outside the solver). Up to now, I did not use createFields for this function, only for the solver. I hoped there was an easy way to read them just like for a single phase flow.

Thanks..

Bernhard September 20, 2011 04:17

You can have a peek in the createFields.H file of interFoam to see how it is done.

lindstroem September 20, 2011 04:35

Quote:

Originally Posted by Bernhard (Post 324801)
You can have a peek in the createFields.H file of interFoam to see how it is done.

So in a similar manner like
Code:

twoPhaseMixture twoPhaseProperties(U, phi, "alpha1");
    const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
    const dimensionedScalar& rho2 = twoPhaseProperties.rho2();

Ok, then I need to extend the functions as expected. I hoped to have sth like
Code:

dimensionedScalar nu1(transportProperties.lookup("nu1"));
Thanks!

Bernhard September 20, 2011 04:43

That second option is of course also possible. Did you try it already?

lindstroem September 20, 2011 04:48

Yes, but... it compiles, but I get the error
Code:

keyword nu1 is undefined in dictionary "[..]/constant/transportProperties"

file: [..]constant/transportProperties from line 19 to line 32.


lindstroem September 20, 2011 05:06

twoPhaseMixture.H provides a volScalarField nu so thats the way i will get access to it:
Code:

twoPhaseMixture twoPhaseProperties(U, phi, "alpha1");
const volScalarField& nu = twoPhaseProperties.nu();

Thanks for your help!

Bernhard September 20, 2011 05:16

Quote:

Originally Posted by lindstroem (Post 324807)
Yes, but... it compiles, but I get the error
Code:

keyword nu1 is undefined in dictionary "[..]/constant/transportProperties"

file: [..]constant/transportProperties from line 19 to line 32.


Which means that you have to provide a nu1 in the transportProperties file, but you already found your solution.

lindstroem September 20, 2011 05:20

When I provided a nu1 it was complaining that it did not find a nu (which i did not call any longer from my force-calculation-function). Yes, I'll try it with the scalarField.

Thanks!


All times are GMT -4. The time now is 16:13.