Re: mu in interFoam ...SOLVED
I have worked on this for a few days. I need to output mu during an interFoam run so I can see mu field change as water wave shape changes. I wrote the following code and put it in createField.H. I expect that mixture.mu() calculate mu field at each output time. But I found (viewing using paraFoam) that mu field at each output time doesn't change and is the initial mu field where I set it using setFields. Any help is appreciated!
Code:
volScalarField mu |
Hi Marpole
Currently I am kind of struggling with this problem too, try this one: volScalarField mu ( IOobject ( "mu", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mixture.nu()*rho ); it will write "mu" field in every time step, but it doesn't change over time:(. BTW I want to use "mu" field to add a kinematicCloud to interfoam and I tried this: basicKinematicTypeCloud kinematicCloud ( kinematicCloudName, rho, U, mu, g ); it works, but I do not know where and how to update the "mu" field and it is important for computing Re number and Drag Coefficient that affects motion of particles.If you have found anything helpful, I will appreciate sharing it with me. Regards |
Re: mu in interFoam
Hi Mohammad,
I will share the solution with if I come up one. So far, I want to give up using mixture.mu() but use something like Code:
volScalarField mu Regards, |
Re: mu in interFoam
Hello Mohammad,
I figured it out. In interFoam, you need add following line within the loop. Code:
mu = mixture.mu(); |
Hi Charles,
Thank you very much for sharing your findings. It worked for me too!! I put it right after pimple.loop() and before evolving the cloud. Best regards, |
Hi! I just want to add something as it took me a while to realize
To write/load mu into the objectRegistry without declaring it beforehand e.g. in the createFields.H file, one must not forget to declare it in the pimple.loop(): HTML Code:
volScalarField mu = mixture.mu(); |
Hello,
I am trying to add mu to interFoam as well. (OpenFOam v7) I have the following:(I have used different color for things that I added Code:
Info<< "Reading transportProperties\n" << endl; Code:
./createFields.H:107:40: error: ‘class Foam::immiscibleIncompressibleTwoPhaseMixture’ has no member named ‘nu1’; did you mean ‘nu’? |
It was a long time ago. Can you help me to explain what you need to do?
If you want just to output mu of the mixture, you can, as Anna F said, declare mu in the loop of interFoam. And in volSaclarField mu in createFields.H, add mixture.mu() to calculate mu for the mixture. I believe there is no nu1 and nu2 like rho1 and rho2. |
I have the same problem. Please can you share the code here?
Kind regards, Renos |
For openfoam-8, you can make two changes as described below.
1. Add a line (highlighted) for computing mu in file interFoam.C before runTime.write(). Code:
if (pimple.turbCorr()) Code:
// Need to store rho for ddt(rho, U) |
Dear Charles,
Thank you very much for your valuable help and quick response. Now, the solver is compiled without errors! Kind regards, Renos |
All times are GMT -4. The time now is 23:39. |