|
[Sponsors] |
Accessing information about Volume Fraction of Phases |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 30, 2014, 08:40 |
Accessing information about Volume Fraction of Phases
|
#1 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
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 C++ skills are way too basic so you would also have to explain about changes in the header file. Thanks!! PS:
|
|
April 30, 2014, 13:06 |
|
#2 | |
Senior Member
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13 |
Quote:
Code:
Foam::tmp<Foam::volScalarField> Foam::viscosityModels::NewCrossPowerLaw::calcNu() const { return (nu0_ - nuInf_)/(scalar(1) + pow(m_*strainRate(), n_)) + nuInf_; } 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; } 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. |
||
May 2, 2014, 02:17 |
|
#3 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
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. |
|
May 2, 2014, 12:45 |
|
#4 |
Senior Member
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13 |
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. |
|
Tags |
openfoam, viscosity models |
|
|
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 |