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

varying rho value in interfoam

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 2, 2012, 07:39
Default varying rho value in interfoam
  #1
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13
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 3, 2012, 00:24
Default
  #2
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
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 3, 2012, 00:38
Default
  #3
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
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 3, 2012, 00:47
Default
  #4
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
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, 04:29
Default
  #5
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13
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, 07:57
Default
  #6
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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, 15:51
Default
  #7
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13
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, 15:55
Default
  #8
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13
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, 21:45
Default
  #9
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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, 06:03
Default
  #10
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13
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, 17:15
Default
  #11
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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, 06:02
Default
  #12
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
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 09:33
Error while running rhoPisoFoam.. nileshjrane OpenFOAM Running, Solving & CFD 8 August 26, 2010 13:50
Error log vw.cfd OpenFOAM 6 August 7, 2009 06:44
Turbulence Model in interFoam some soul searching jaswi OpenFOAM Running, Solving & CFD 0 July 3, 2007 11:13


All times are GMT -4. The time now is 03:22.