How to retrieve nu1 and nu2
Hi everybody,
I need to retrieve nu1 and nu2 for the calculation of mu1 and mu2 (adapting interFoam). I added the following code into the createFields.H file, to the section "Reading transport properties". Code:
const viscosityModel& nu1 = mixture.nuModel1(); Quote:
|
Hi Elisabeth,
the nuModel1() method does not return a scalar, but a reference to a viscosityModel. The compiler is telling you that you cannot multiply two variables of different type. nu1 is a constant reference to a Foam::viscosityModel object, whilst rho1 is referring to a const Foam::zeroField. Easiest way I can think of to access the values of the kinematic viscosity of your phases is to read them directly from the transportProperties file, something like: dimensionedScalar nu1 ("nu", dimensionSet(0, 2, -1, 0, 0), 0); ( nu1 = transportProperties.subDict("fluid1").lookup("nu") ); where "fluid1" is the name of the first phase. You can probably avoid to manually insert the name by replacing "fluid1" with something like mixture.phase1Name(). Did not test it, but it should work. Andrea Andrea |
Hi Andrea,
thank you very much for your helpful answer! It worked for me when I additionally insert the following to declare transportProperties: Code:
IOdictionary transportProperties |
Yes, I assumed you had already instantiated your transport properties dictionary.
Glad to know it worked ;) Andrea |
All times are GMT -4. The time now is 05:42. |