# FvVectorMatrix questions

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 1, 2006, 07:29 hi all, i try to change the #1 Senior Member   Stephan Gerber Join Date: Mar 2009 Location: Germany Posts: 118 Rep Power: 12 hi all, i try to change the piso algorithm for incomp. flows (zero divergence condition) to a piso for incomp. flow with a given divergence that is non zero but constant for one timestep. ( the value will change over time but is known) in this forum it was mentioned that UEqn.H() gives something like \sum_n a_n u_n. is the pressure gradient and the old-value for the velocity U included in Ueqn.H()??? Does UEqn.H change the a_n if U changes or are the coefficients constant for one timestep. and if the pressure gradient in included in UEqn.H(), does UEqn.H() change when the pressure changes? i hope somebody can help me.. thanx in advance stephan

 February 1, 2006, 10:08 Continuity Eq: div(U) = 0 and #2 Super Moderator     Niklas Nordin Join Date: Mar 2009 Location: Stockholm, Sweden Posts: 694 Rep Power: 24 Continuity Eq: div(U) = 0 and with source term: div(U) = S Discretised momentum eq. A*U = H - grad(p) -> U = H/A -(1/A)*grad(p) = Ustar - (1/A)*grad(p) H/A is the momentum-predictor value of U, ie Ustar. if we insert this in the continuity eq. it yields div(U) = div(Ustar - (1/A)*grad(p)) = S -> div(Ustar) - laplacian(1/A, p) = S or laplacian(1/A, p) = -S + div(phi) where phi is Ustar evaluated on faces. have a look at icoFoam and you will easily see where to insert S. N

 February 1, 2006, 10:36 hi niklas, at first: thanx #3 Senior Member   Stephan Gerber Join Date: Mar 2009 Location: Germany Posts: 118 Rep Power: 12 hi niklas, at first: thanx a lot!! i was just concerned if i have to include the source once(first corrector step) in the pressure equation or twice(in the second corrector-step) , what just depends on how it is implemented - the paper of Issa(1985) - the first PISO-paper i guess - has two different approaches for the solution of such systems. i would be still interested in whether the discretised flux changes when i do something like the following lines or not: U=UEqn.H()/UEqn.A(); do something.. U=somthing else U=UEqn.H()/UEqn.A(); does a_n change with U()-changes? i hope the questions are not too ... - sorry but i am pretty new in c++ in still new into Foam stephan

 February 1, 2006, 10:54 1. The first step is based on #4 Super Moderator     Niklas Nordin Join Date: Mar 2009 Location: Stockholm, Sweden Posts: 694 Rep Power: 24 1. The first step is based on the momentum, so if you want to add a force, you should do this here. 2. The 'second' step solves pressure to satisfy the continuity eq. and after updates U. If you have a source term due to mass transfer, this should be added here. So do not add the same source to both steps, since Im guessing that it will not be the same mass and momentum source. If UEqn.A() changes.... This is so easy to check for yourself. In fact, I suggest you answer this yourself as an exercise. If you run the cavity example with only, lets say 2x2x1 cells and write out the U, UEqn.A() and UEqn.H() after each of the above steps you will find out for yourself. I.e. just add: Info << U << endl; Info << UEqn.A() << endl; Info << UEqn.H() << endl; at suitable positions in the code N

 February 1, 2006, 11:01 hi niklas, i will exercise #5 Senior Member   Stephan Gerber Join Date: Mar 2009 Location: Germany Posts: 118 Rep Power: 12 hi niklas, i will exercise that thanx!! stephan

 May 4, 2007, 07:08 Hi, So if I change the mome #6 Member   Erik Arlemark Join Date: Mar 2009 Location: Eindhoven, Netherlands Posts: 47 Rep Power: 12 Hi, So if I change the momentum equation for solving U (first step) I wont need to change the form of the semi discretised momentum equation in step 2? Does the change follow the A and H matrixes? regards Erik

 May 4, 2007, 07:23 yep, the discretised momentum #7 Senior Member   Markus Hartinger Join Date: Mar 2009 Posts: 102 Rep Power: 12 yep, the discretised momentum equation is generic. Meaning, that however you construct the momentum equation itself, you don't need to change the discretised equation. 'A' contains the diagonal matrix coefficients, 'H' contains the off-diagonal coefficients times velocity. So, any change in the matrix setup will be reflected in 'A' and 'H'