varying rho value in interfoam
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 :) |
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.
|
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. |
Assuming you declared the density field correctly, you could try this in the twoPhaseTransportProperties library,:
const volScalarField& rho = mesh().lookupObject<volScalarField>("myRhoField"); |
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 :).
|
look at compressibleInterFoam, it gives you the idea how to implement a varialbe rho! in that solver rho is varying by pressure!
|
@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 :) |
@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 :) |
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 |
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 |
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 |
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 |
All times are GMT -4. The time now is 13:12. |