CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

mixture.correct()?

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By ssss
  • 3 Post By Saideep

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2015, 13:32
Default mixture.correct()?
  #1
Senior Member
 
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12
Saideep is on a distinguished road
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
Saideep is offline   Reply With Quote

Old   May 16, 2015, 06:08
Default
  #2
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 12
ssss is on a distinguished road
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
linyanx likes this.
ssss is offline   Reply With Quote

Old   May 16, 2015, 07:30
Default Update!!
  #3
Senior Member
 
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12
Saideep is on a distinguished road
Thanks a lot buddy!!

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

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 is offline   Reply With Quote

Old   October 5, 2015, 12:10
Smile
  #4
Senior Member
 
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12
Saideep is on a distinguished road
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
Saideep is offline   Reply With Quote

Old   April 25, 2018, 14:03
Smile
  #5
Member
 
Mohammad Reza
Join Date: Sep 2015
Posts: 44
Rep Power: 10
Bana is on a distinguished road
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
Bana is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 23:56.