
[Sponsors] 
November 26, 2007, 17:06 
Dear all,
I am trying to bu

#1 
New Member
Ido Silverman
Join Date: Mar 2009
Posts: 13
Rep Power: 8 
Dear all,
I am trying to build a cavitation flow model with dynamic mesh. However, I have a mass conservation problem when I use a moving mesh. At first, I modified cavitatingFoam solver to have moving mesh, then I modified sonicFoamAutoMotion to include barotropic cavitating model as with cavitatingFoam. With both solvers I have the same problem. Mass do not conserve as soon as vapor fraction increases if I use a moving mesh. I have two test problems. The first is a close volume with a boundary condition of constant flow out on one of the boundaries. The conditions in the volume change from liquid to a mixture of liquid and vapor as the density and pressure decrease due to the flow out. In the other case, I use moving mesh to simulate the expansion of the volume in order to get similar density and pressure decrease. As before, the conditions change from one to two phases. However, there is a small increase of total mass even though the mass flux over the boundaries is zero (I have checked it with the surfaceIntegrate function.) I would appreciate any help to locate the source of this error. I attach three files with the solver based on sonicFoamAutoMotion and the two test problems. cavSonicMoMFoam.tgz decompressionSV15.tgz decompressionDV15.tgz Best regards, Ido 

November 26, 2007, 19:20 
You have, of course, made sure

#2 
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,763
Rep Power: 21 
You have, of course, made sure that the mesh motion terms are added correctly to your momentum and pressure equation. Also, check the flux through moving walls to make sure you set up the boundary conditions correctly.
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk 

November 27, 2007, 15:07 
Dear Hrv,
Thanks for the ad

#3 
New Member
Ido Silverman
Join Date: Mar 2009
Posts: 13
Rep Power: 8 
Dear Hrv,
Thanks for the advice. I have checked the boundary conditions and the calculation of the fluxes on the face (I did surfaceInegrate to get the flux into each cell and then domainIntegrate to get the total flux in/out of the domain). For all practical purpose it was zero (if not exactly zero than in the order of 1e20 or lower). Phi itself is practically zero on the domain boundaries (I print this field). The error is probably due to inconsistent writing of the equations or in calculating one or some of the terms. However, I could not find it yet. One problem I found with moving mesh is in the calculation of the time derivative of a field which has limiting values. For example, let look at the vapor fraction gamma which can be between zero and one only. The time derivative for Euler method with moving mesh is calculated as (gamma1 – gamma0*v0/v1)/dt where index 1 is for current conditions and 0 for previous time step. In any cell where gamma0=1 the multiplication of gamma by the volumes fraction is not correct. In most cases local conditions prevent change in gamma. The change in cell volume will influence the fluid by other parameters but not the volume fraction. In the test problem this problem do not has any effect since for gamma=0 the multiplication has no effect. However, due to this problem I replaced the ddt(psi) term which appears in the original cavitatingFoam solver by the term (dPsi/dGamma)*ddt(gamma) (psi is function of gamma only, all other parameters are constants). Best regards, Ido 

November 27, 2007, 18:27 
Well Ido, that leaves only one

#4 
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,763
Rep Power: 21 
Well Ido, that leaves only one possibility: you did not account for mesh motion fluxes from phi after solving the pressure equation. Did you account for mesh motion when solving for phi and subtract mesh.phi() as appropriate?
There are two things you can check:  volume conservation: ddt(1)  div(mesh.phi()) = 0  mass conservation, the usual way. If both are satisfied, you will preserve boundedness on a moving mesh. Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Mass Conservation in LES  Sas  Main CFD Forum  3  July 6, 2007 10:37 
Mass Conservation  Prabhas  FLUENT  0  December 5, 2006 02:15 
mass conservation  mange  FLUENT  0  July 20, 2006 07:08 
Mass Conservation in LES  Jaswant  Main CFD Forum  8  July 4, 2005 22:32 
Mass Conservation  Balaji  FLUENT  0  May 11, 2005 07:16 