|
[Sponsors] |
August 2, 2012, 07:39 |
varying rho value in interfoam
|
#1 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13 |
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 |
|
August 3, 2012, 00:24 |
|
#2 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17 |
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.
|
|
August 3, 2012, 00:38 |
|
#3 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17 |
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. |
|
August 3, 2012, 00:47 |
|
#4 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17 |
Assuming you declared the density field correctly, you could try this in the twoPhaseTransportProperties library,:
const volScalarField& rho = mesh().lookupObject<volScalarField>("myRhoField"); |
|
August 4, 2012, 04:29 |
|
#5 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13 |
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 .
|
|
August 11, 2012, 15:51 |
|
#7 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13 |
@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 |
|
August 11, 2012, 15:55 |
|
#8 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13 |
@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 |
|
August 11, 2012, 21:45 |
|
#9 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
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 |
|
August 12, 2012, 06:03 |
|
#10 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13 |
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 |
|
August 12, 2012, 17:15 |
|
#11 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
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 |
|
April 14, 2015, 06:02 |
|
#12 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
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 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |