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

Accessing information about Volume Fraction of Phases

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 30, 2014, 08:40
Default Accessing information about Volume Fraction of Phases
  #1
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23
vasava will become famous soon enough
I want to write a new viscosity model where viscosity is also a function of volume fraction of one of the phases in a multiphase flow.

I have played a bit with CrossPowerLaw. I made some minor modifications and everything was nice. I understood that this piece of code does is the main equation for the viscosity model.

Code:
Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::NewCrossPowerLaw::calcNu() const
{
    return (nu0_ - nuInf_)/(scalar(1) + pow(m_*strainRate(), n_)) + nuInf_;
}
My question is how do I add information about volume fraction of certain phase into this code?? For example I want to multiply the final viscosity with volume fraction of one of the phases.

My C++ skills are way too basic so you would also have to explain about changes in the header file.

Thanks!!

PS:
  1. I would use this with twoPhaseEulerFoam or multiphaseEulerFoam.
  2. I have openfoam 2.3.0
vasava is offline   Reply With Quote

Old   April 30, 2014, 13:06
Default
  #2
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by vasava View Post
I want to write a new viscosity model where viscosity is also a function of volume fraction of one of the phases in a multiphase flow.

I have played a bit with CrossPowerLaw. I made some minor modifications and everything was nice. I understood that this piece of code does is the main equation for the viscosity model.

Code:
Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::NewCrossPowerLaw::calcNu() const
{
    return (nu0_ - nuInf_)/(scalar(1) + pow(m_*strainRate(), n_)) + nuInf_;
}
My question is how do I add information about volume fraction of certain phase into this code?? For example I want to multiply the final viscosity with volume fraction of one of the phases.

My C++ skills are way too basic so you would also have to explain about changes in the header file.

Thanks!!

PS:
  1. I would use this with twoPhaseEulerFoam or multiphaseEulerFoam.
  2. I have openfoam 2.3.0
In the code which variable is the final viscosity?

Code:
Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::NewCrossPowerLaw::calcNu() const
{
    return (nu0_ - nuInf_)/(scalar(1) + pow(m_*strainRate(), n_)) + nuInf_;
}
I'm assuming it's

nuInf_


so you would create it (volume fraction)

double vol_frac = function_for_calculation_of_vol_frac();


and then plug it into the code

Code:
Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::NewCrossPowerLaw::calcNu() const
{
    double vol_frac = function_for_calculation_of_vol_frac();

    return (nu0_ - nuInf_*vol_frac)/(scalar(1) + pow(m_*strainRate(), n_)) + nuInf_*vol_frac;
}
I'm not sure what the type for nuInf_ is. What file is this in by the way?


For the header file you would need to add the function for

function_for_calculation_of_vol_frac()

if not then you would need to include the volume fraction calculation within the function Foam::viscosityModels::NewCrossPowerLaw::calcNu() and there's no need to change any header file.

Last edited by massive_turbulence; May 1, 2014 at 16:24.
massive_turbulence is offline   Reply With Quote

Old   May 2, 2014, 02:17
Default
  #3
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23
vasava will become famous soon enough
Thanks for your response.

This code as I mentioned is from CrossPowerLaw. I have included this code just for illustration. Right now I do not know how to include the information about the volume fraction of a phase.
vasava is offline   Reply With Quote

Old   May 2, 2014, 12:45
Default
  #4
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by vasava View Post
Thanks for your response.

This code as I mentioned is from CrossPowerLaw. I have included this code just for illustration. Right now I do not know how to include the information about the volume fraction of a phase.
How is the 'volume fraction of the phase' calculated though, surely there's a simple formula (I think I remember something about this from thermo)? You might be able to read data from a dat file using fstream although if time dependence is necessary or some other variable changes then the function call would get more difficult to implement.

Last edited by massive_turbulence; May 2, 2014 at 17:31.
massive_turbulence is offline   Reply With Quote

Reply

Tags
openfoam, viscosity models


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
volume fraction in mixture model and VOF???? multiphase-flow FLUENT 4 August 7, 2014 11:35
InterFoam channel Flow runnig very slowly Wokl OpenFOAM Running, Solving & CFD 4 January 9, 2014 03:52
assuming Volume fraction water =0 to volume fraction=0.5 flow_CH FLUENT 9 December 16, 2013 13:29
Help on accessing volume fraction in mixture model achuneka FLUENT 8 September 4, 2009 07:22
interDyMFoam - change in volume fraction gopala OpenFOAM Running, Solving & CFD 0 April 27, 2009 11:46


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