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

varying rho value in interfoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 2, 2012, 06:39
Default varying rho value in interfoam
  #1
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 5
shash is on a distinguished road
hi all openfoamers,

i have been trying to inculcate a variable rho for one of the phases in openfoam but could not do it , rho has been defined as dimensionedscalar in interfoam for both phases but i want volscalarfield for at least one of the phases, can someone help me with this
shash is offline   Reply With Quote

Old   August 2, 2012, 23:24
Default
  #2
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 268
Rep Power: 8
kmooney is on a distinguished road
interFoam calculates rho with a color function (alpha) weight. Off the top of my head, for a particular cell the density rho=rho1*(alpha)+(1-alpha)*rho2. If you are trying to alter one of the density fields you might have to get fancy with the density treatment.
kmooney is offline   Reply With Quote

Old   August 2, 2012, 23:38
Default
  #3
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 268
Rep Power: 8
kmooney is on a distinguished road
In order to make this change you'll need to declare a density field (volScalarField) and change out the density and viscosity computation in /src/transportModels/incompressible/incompressibleTwoPhaseMixture

To perform the computations in the two phase mixture library you might have to do a database look up to grab the density field you made above. I'll try to find some syntax to make that easy.
kmooney is offline   Reply With Quote

Old   August 2, 2012, 23:47
Default
  #4
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 268
Rep Power: 8
kmooney is on a distinguished road
Assuming you declared the density field correctly, you could try this in the twoPhaseTransportProperties library,:

const volScalarField& rho =
mesh().lookupObject<volScalarField>("myRhoField");
kmooney is offline   Reply With Quote

Old   August 4, 2012, 03:29
Default
  #5
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 5
shash is on a distinguished road
thanks kyle for ur detailed answer , i already tried creating volscalarfield for rho2 but didn't really know where else changes need to be done , i will try ur changes .
shash is offline   Reply With Quote

Old   August 4, 2012, 06:57
Default
  #6
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
look at compressibleInterFoam, it gives you the idea how to implement a varialbe rho! in that solver rho is varying by pressure!
nimasam is offline   Reply With Quote

Old   August 11, 2012, 14:51
Default
  #7
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 5
shash is on a distinguished road
@nimasam : can i just change p from the rho eqn. and replace with a new scalarfield may be s1 , since most of the strategies used in compressibleinterfoam are same as in interfoam , can you plaese tell me what are the differences in these two.
thanks
shash is offline   Reply With Quote

Old   August 11, 2012, 14:55
Default
  #8
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 5
shash is on a distinguished road
@kyle : i tried ur method but didn't work , may be i did something work
"Assuming you declared the density field correctly, you could try this in the twoPhaseTransportProperties library,:

const volScalarField& rho =
mesh().lookupObject<volScalarField>("myRhoField");
"

this part was not clear to me , please detail it a little.
thanks
shash is offline   Reply With Quote

Old   August 11, 2012, 20:45
Default
  #9
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
Hi shashank
its better you define your question better, how rho changes?
but about your question, as you said the main part of interFoam and compressilbeInterFoam are the same! however interFoam solve for constant rho and it is for incompressilbe flow, but compressibleInterFoam defines rho as function of pressure, actually it considers both phase as isothermal perfect gas which
rho=rho0+si*p and si is 1/RT ,
also check pEqn.H and alphaEqn.H to see how to consider compressibility in Equations
nimasam is offline   Reply With Quote

Old   August 12, 2012, 05:03
Default
  #10
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 5
shash is on a distinguished road
hi nimasam,

i am trying to implement rho=rho0+k*s1; k=constant and s1 is a volscalarfield , so i was thinking if just replacing p with s1 will do the job
shash is offline   Reply With Quote

Old   August 12, 2012, 16:15
Default
  #11
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
not exactly!
as i said before its better to compare interFoam and compressibleInterFoam to see how rho dependency to pressure has effect in equations specially in pEqn.H and alphaEqn.H
nimasam is offline   Reply With Quote

Old   April 14, 2015, 05:02
Default
  #12
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 67
Rep Power: 5
kebsiali is on a distinguished road
dear shiv

Sorry for bringing this post up from the grave
but did you succeed in implementing a variable density (for one of the phases)
if yes can you please help my showing how

my density is a function of T,P, and some other passive scalars but first i want to know how to turn it into volScalarField, what and where to make changes so everything adapts with it.

Thanks in advance
kebsiali is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SLTS+rhoPisoFoam: what is rDeltaT??? nileshjrane OpenFOAM Running, Solving & CFD 4 February 25, 2013 05:13
varying rho in twoPhaseEulerFoam shash OpenFOAM Programming & Development 1 July 9, 2012 08:33
Error while running rhoPisoFoam.. nileshjrane OpenFOAM Running, Solving & CFD 8 August 26, 2010 12:50
Error log vw.cfd OpenFOAM 6 August 7, 2009 05:44
Turbulence Model in interFoam some soul searching jaswi OpenFOAM Running, Solving & CFD 0 July 3, 2007 10:13


All times are GMT -4. The time now is 20:53.