CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   mixture.correct()? (https://www.cfd-online.com/Forums/openfoam-programming-development/152998-mixture-correct.html)

Saideep May 14, 2015 13:32

mixture.correct()?
 
hi FOAMers;

Wishing you a very good day.

I am working with the new version(OF-2.3.1) interFOAM and trying to change from default PIMPLE to PISO solver. On the way, I have a question in the original openfoam interFoam.C file, regarding, from where is the mixture.correct() function being called to correct the kinematic viscosity. In older versions it was twoPaseProperties.correct(). Even in older versions of github files i failed to find the object twoPhaseProperties.

Could anyone shed some light over this topic?

Thanks and waiting for your answer.

Saideep

ssss May 16, 2015 06:08

I think that it is dealt inside the turbulenceModel, so when you create the turbulence model:

Code:

    autoPtr<incompressible::turbulenceModel> turbulence
    (
        incompressible::turbulenceModel::New(U, phi, mixture)
    );

It automatically reads from the mixture the mu's, and corrects the turbulence itself, without calling any other function than:

Code:

turbulence->divDevRhoReff(rho, U)
This should be the way it should work I think

Saideep May 16, 2015 07:30

Update!!
 
Thanks a lot buddy!!

Appreciate your time and effort in my case. I guess even you are on the same track as of mine.:p

As of now I understand a bit of your answer(not completely as I am not working with turbulence as of now, i am just changing the default damBreak code from PIMPLE to PISO.) {Reason: I am dealing with interface motion of 2 phases. So, papers that i had read from Ivan Lunati, Raeini, Duon and so on all use PISO algorithm instead of PIMPLE. I dont know the reason as of now and for basic simulations I compared between my results and their results and they are different, so I thought to have a go on PISO once to see if it really works.}

I would be greatful if anyone could explain how PISO is different from PIMPLE (not theoritical(PIMPLE = PISO+SIMPLE) but with help of code.).

Now coming to our original question between twoPhaseProperties and mixture, I someow feel it is deep hidden somewhere and the latest version from 2.3.x the twoPhaseProperties have been replaced with mixture object.{Still searching where it is defined and I find this usage in net but its definition is not been seen.}
And search for definition continues and if anybody comes across this it is worth to share.

Thanks a lot once again from my side for your intrest!!
hope to find the solution soon.

Saideep October 5, 2015 12:10

Hi,

Just came across my old post and wanted to close, what mixture really meant here in createFields.H

This is nothing but an object created to the class "interfaceProperties" and passing arguments to the constructor. So, by declaring this object we also made a call to the constructor function in the interfaceProperties class.

Further, mixture.correct() and so on call the respective functions in the class with the help of the object 'mixture' created.

Hope this helps!!:)
Saideep

Bana April 25, 2018 14:03

Hi Saideep

I am currently trying this in CreatFields.H of interFoam to see variation of viscosity over time:

volScalarField mu
(
IOobject
(
"mu",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mixture.nu()*rho
);

But in every timestep the output "mu" file is the same. my primary goal is to add kinematicCloud to interfoam and enable particle tracking. so i need "mu" field to create the kinematicCloud, like this:

basicKinematicTypeCloud kinematicCloud
(
kinematicCloudName,
rho,
U,
mu,
g
);

it seems the "mu" field should be updated by calling the function mixture.correct() in interFoam.C, but it is not so. after following the src files I think because the function calcNu() in incompressibleTwoPhaseMixture.C is a private one, it doesn't update the field
void Foam::incompressibleTwoPhaseMixture::calcNu()
{
nuModel1_->correct();
nuModel2_->correct();

const volScalarField limitedAlpha1
(
"limitedAlpha1",
min(max(alpha1_, scalar(0)), scalar(1))
);

// Average kinematic viscosity calculated from dynamic viscosity
nu_ = mu()/(limitedAlpha1*rho1_ + (scalar(1) - limitedAlpha1)*rho2_);
}

any suggestion on how and where to update the "mu" field would be appreciated.

best regards


All times are GMT -4. The time now is 14:44.