
[Sponsors] 
Why we subtract continuity Eqn into momentum Eqn instead of adding it? 

LinkBack  Thread Tools  Display Modes 
April 27, 2015, 03:14 
Why we subtract continuity Eqn into momentum Eqn instead of adding it?

#1 
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 754
Rep Power: 10 
Hey guys,
This piece of code is quite common in OpenFOAM； Code:
fvm::ddt(alpha1, U1) //mom eqn fvm::Sp(fvc::ddt(alpha1),U1) //continuity eqn + fvm::div(alpha1, U1) //mom eqn  fvm::Sp(fvc::div(alpha1), U1) ////continuity eqn Code:
fvm::ddt(alpha1, U1) //mom eqn +fvm::Sp(fvc::ddt(alpha1),U1) //continuity eqn + fvm::div(alpha1, U1) //mom eqn +fvm::Sp(fvc::div(alpha1), U1) ////continuity eqn 

April 27, 2015, 05:38 

#2 
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 7 
I dont really know
normally we seek diagnal dominance, so i would say so but thats the contrary of what is done here ?????? 

April 27, 2015, 11:31 

#3 
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 754
Rep Power: 10 
Yep...Wish someone who can explain this. lol


April 27, 2015, 12:32 

#4 
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 260
Rep Power: 11 
Hi,
Actually, we subtract a momentum transfer term because the real equation (left hand side of NS) we want to solve is which is written in a nonconservative form. In FVM, however, we prefer conservative form, These two equations are not the same if the fluid is not incompressible or if there is phase change. You can notice that you can switch from nonconservative to conservative form with, So adding the continuity equation do not have any sense. Cheers, 

April 28, 2015, 02:21 

#5 
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 754
Rep Power: 10 
Quote:
Yeah, The problem is why we want to solve the first Eqn in your posts. The reason why I ask this kind of problem is that: "openfoam22x is solving nonconservative equations but 23x is solving conservative eqns."for twofluid model. So I think the thing deeper is : 1. Why we solve Eqn 2 instead of Eqn 1. I saw some posts that Hrv and Henry explain this, They just said the conservative eqn is stable and good. I dont know the reason. 2. Eqn 2 and Eqn 1 should predicts the same results rite? But sometimes it does not. Best, 

April 28, 2015, 11:39 

#6 
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 260
Rep Power: 11 
Hi Dongyue,
Eq 1 and Eq 2 are equivalent only if the continuity equation (equal to zero) is satisfy. I guess that since we deal with an operatorsplitting scheme (first we solve the momentum, then the pressure, then the correction, then we iterate), the continuity equation is not fully respected, and that why we add to add this term, to avoid spurious momentum transfer due to an illevaluation of the continuity. Cheers, 

June 3, 2015, 12:00 

#7  
Member
Bruno Blais
Join Date: Sep 2013
Location: Canada
Posts: 66
Rep Power: 6 
Quote:
Equation 1 and 2 are not equivalent numerically because they do not allow for the same Riemann invariant. If you take the example of a shockwave or any other type of discontinuity, as a CauchyRiemann classical problem, you find that the wave propagation / shock propagation/ discontinuity propagation will be at the wrong velocity if you do not formulate your problem using the conserved variables. I am not familiar with these issues in the context of two phases flows, but for compressible flows this is an extremely critical issue and you always need to formulate the problem in conservative variables (rho, rho * u, rho * e). I believe that since these multiphase flows contain large amount of discontinuity in the phases (like air on top of water or whatever), a conservative formulation is a lot more appropriate if you want to obtain the right propagation of the interface. There is a very very nice book by Euleterio Toro on hyperbolic systems that discusses these issues if I remember. 

June 4, 2015, 05:20 

#8 
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 142
Rep Power: 7 
Hi,
I am confused with these statements. Sharonyue refers to the alpha1Eq, not the momentum equation. In interDymFoam, I have the following code: Code:
fvScalarMatrix alpha1Eqn ( #ifdef LTSSOLVE fv::localEulerDdtScheme<scalar>(mesh, rDeltaT.name()).fvmDdt(alpha1) #else fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1) #endif + fv::gaussConvectionScheme<scalar> ( mesh, phiCN, upwind<scalar>(mesh, phiCN) ).fvmDiv(phiCN, alpha1) ); I changed to: Code:
fvScalarMatrix alpha1Eqn ( #ifdef LTSSOLVE fv::localEulerDdtScheme<scalar>(mesh, rDeltaT.name()).fvmDdt(alpha1) #else fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1) #endif + fv::gaussConvectionScheme<scalar> ( mesh, phiCN, upwind<scalar>(mesh, phiCN) ).fvmDiv(phiCN, alpha1)  fvc::div(phi)*fvm::Sp(1,alpha1) ); By the way, for compressible solvers, this code is wrong (div phi is not zero, but div rho phi. Regards, Daniel 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Micro Scale Pore, icoFoam  gooya_kabir  OpenFOAM Running, Solving & CFD  2  November 2, 2013 14:58 
How to write k and epsilon before the abnormal end  xiuying  OpenFOAM Running, Solving & CFD  8  August 27, 2013 15:33 
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3  bookie56  OpenFOAM Installation  8  August 13, 2011 04:03 
IcoFoam parallel woes  msrinath80  OpenFOAM Running, Solving & CFD  9  July 22, 2007 02:58 
Could anybody help me see this error and give help  liugx212  OpenFOAM Running, Solving & CFD  3  January 4, 2006 19:07 