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

Thermal+Vof+DynamicRefineMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Cyp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2015, 10:58
Default Thermal+Vof+DynamicRefineMesh
  #1
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Hello to all

Im trying to simulate the creation of polyurethane foam, modelled as mold filling process. where i want to use vof method to follow the formation of the foam.
The reaction is exothermic which can be modeled by adding a source term to the energy equation.

my question is can this be done and with what solver
and how can i use the benefits of daynamic refining mesh if possible.

Thanks in advance,
kebsiali is offline   Reply With Quote

Old   March 11, 2015, 10:09
Question precise question
  #2
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Well, since no one responded, i will, with another more precise question.

my problem reduces to adding many scalar transport equations to (interFoam), the results of these, will affect the density, viscosity, and every single characteristic appearing in all the equations.

I started by a small transport equation that looks like (sorry for the format)
d/dt(rho1 alpha1 C)+div(rho1 alpha1 U1 C)=0 (I'll have to add source term later)

the reason alpha1 appears is that C is transported through phase 1 only.

I made a CEqn.H which i include (after the pressure equation OR after the pimple loop) which contains
______________________________________
rhoAlpha1 == alpha1*rho1;
rhoAlpha1Phi=fvc::interpolate(rhoAlpha1)*phi;

fvScalarMatrix CEqn
(
fvm::ddt(rhoAlpha1, C)
+ fvm::div(rhoAlpha1Phi, C)
);
CEqn.solve();
_______________________________________


I added in creatFields.H the following

_______________________________________
volScalarField rhoAlpha1
(
IOobject
(
"rhoAlpha1",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT
),
alpha1*rho1,
alpha1.boundaryField().types()
);
rhoAlpha1.oldTime();

surfaceScalarField rhoAlpha1Phi
(
IOobject
(
"rhoAlpha1Phi",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::interpolate(rhoAlpha1)*phi
);
_______________________________________

but it gives me crazy results (unstable, unrealistic, diffusive)

Could anyone please give me a hint or direct me what to do or where to look
Thanks in advance.
kebsiali is offline   Reply With Quote

Old   March 11, 2015, 11:58
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Dear Ali,

You probably want to read some topic regarding mass transfer with VOF:

http://www.cfd-online.com/Forums/ope...interface.html

http://www.cfd-online.com/Forums/ope...one-phase.html

Also, I recommend you the very good paper by Yacine Haroun and Dominique Legendre about the implementation of mass transfer equation with partitioning at the fluids interface in a VOF solver. (There is much more details in Yacine Haroun PhD dissertation, it is in French, but I guess you can read it!)
http://www.sciencedirect.com/science...09250910000291

In your case, you can play with the value of the partitioning coefficient to force 0 concentration in the other phase. Actually, it is not only "play" since the real value will satisfy the thermodynamics.

best,
Cyprien
Cyp is offline   Reply With Quote

Old   March 12, 2015, 02:35
Default
  #4
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Dear Cyprien.

I will look into all those links and the PhD,
Thank you very much,
kebsiali is offline   Reply With Quote

Old   March 16, 2015, 02:27
Default
  #5
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Dear Cyprien,
I've looked into what you proposed but haven't tried it yet.
What do you mean by the partitioning coefficient? is it the (Ceq)?


\frac{\partial C}{\partial t}+\nabla \cdot \phi C + \nabla\cdot D \nabla C = \nabla \cdot D C_{eq}\nabla \alpha[LaTeX Error: Syntax error]

and one more thing, i had to show to my profs that the normal method doesn't work, so i tried to debug it to know where the crazy things start to appear. (my problem is not only the diffusion).
and apparantely in my code in CEqn.H where i do
rhoAlpha1Phi=fvc::interpolate(rhoAlpha1)*phi; or rhoAlpha1Phi=fvc::interpolate(alpha1)*rhoPhi;

the code does not do what i intend it to do.
I need to interpolate the values of alpha1 from volScalarField to surface....., otherwise i cant multiply it by phi or rhoPhi which are surfacique.
but what the code does is it returns the same value of rhoPhi, as if the result of fvc::interpolate(alpha1) is equal to (1) everywhere.

I have to show how much diffusive the method would be.

Thanks in advance.
kebsiali is offline   Reply With Quote

Old   March 16, 2015, 10:08
Default
  #6
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Hi Ali,

I am not this solution work. The one on the first post, however, works for sure. Look at this post:

http://www.cfd-online.com/Forums/ope...tml#post392947

The partionning coefficient is H (Henry's law)
Cyp is offline   Reply With Quote

Old   March 20, 2015, 10:29
Question
  #7
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Dear Cyprien,

It took sometime to implement, but here is how it looks


B=Dtt*(1-Henry)/(alpha1*Henry +1-alpha1)*C;


fvScalarMatrix CEqn
(
fvm::ddt( C)
+ fvm::div(phi, C)
+ fvm::laplacian(Dtt, C)
== fvc::laplacian(B, alpha1)
);

I tried to play with the value of Dtt( between 1e-9 and 1e-12)
and I played with Henry ( from 1e-6 to 100)
but the diffusion is still present.

Do I have a missed sign anywhere, are the values of Dtt not realistic (For polyurethane Foam) or what suggestions might you have?

Thank you in advance
kebsiali is offline   Reply With Quote

Old   March 20, 2015, 11:32
Default
  #8
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
try a van Leer scheme for fvm::div(phi, C)

also, use a smaller time step.

The spurious fluxes are known (cf the paper of Yacine Haroun), and you can minimize them with smart interpolation, altough I never tried that.
Cyp is offline   Reply With Quote

Old   March 23, 2015, 04:46
Default
  #9
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Dear Cyprien,

Actually the vanLeer, small dt, higher nAlphaSubCycle combination elimenated the spruious fluxes without the need of H; in other words even if H=1 the the C 'species concentration' is held in phase 1 with no fluxes at all.
The interphase thickness is also non-dependant on H. However, the interphase for C is more smeared -thicker- than that of alpha.
One more thing, the case i'm treating now is non-realistic, im just adding the transport equation to a water-air system, so maybe when i treat my system the effect of H will appear.
kebsiali is offline   Reply With Quote

Old   March 26, 2015, 05:49
Default
  #10
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Dear Cyprien,

Thanks you all your help, i got over this part of my problem
I have a stupid question,
In the species conservation equation, if my density is not constant rho=f(C1,C2,.....Cn,T,P)
is it ok if i write the species conservation equation as ddt(C)+ div(phi,C)....... without the rho appearing inside the derivatives
kebsiali is offline   Reply With Quote

Old   March 30, 2015, 16:39
Default
  #11
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
You either have,

\frac{\partial C}{\partial t} + \nabla . \left( \mathbf{v} C \right)

or

\frac{\partial \rho \omega }{\partial t} + \nabla . \left(  \rho  \mathbf{v} \omega \right)

where \omega is the mass fraction of your species. So yes, the first equation is correct, regardless the dependence of rho on the other species.

Best,
kebsiali likes this.
Cyp is offline   Reply With Quote

Old   April 14, 2015, 02:52
Default
  #12
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Dear Cyprien,

Sorry to bring this up again,
I had a discussion with my prof. about adding the rho into the transport equation
what im transporting is the chemical conversion

x=\frac {c_0 - c}{c_0}

so i expect the rho to not appear simply because c=c0(1-x)
while my prof expects to see the rho as x can be seen to represent a weight fraction(to the initial state)
What do you suggest or think
kebsiali is offline   Reply With Quote

Reply


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
Thermal conductivity issue Jared1986 CFX 3 March 20, 2014 10:38
IAPWS water properties + orthotropic thermal conductivity Chander CFX 1 February 29, 2012 17:26
VOF with air compressible and thermal effect Pei-Ying Hsieh Main CFD Forum 0 January 7, 2009 15:27
Short Course: Computational Thermal Analysis Dean S. Schrage Main CFD Forum 11 September 27, 2000 17:46
Info: Short Course On Thermal Design of Electronic Equipment Arnold Free Main CFD Forum 0 August 10, 1999 10:18


All times are GMT -4. The time now is 06:17.