# Foam::lduMatrix::faceH

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

 September 22, 2009, 06:21 Foam::lduMatrix::faceH #1 New Member   Yijin Li Join Date: Mar 2009 Posts: 13 Rep Power: 15 Based on the pressure solution, assemble conservatie face flux F F=s_f*H(u)-a_p_n(p_n-p_p) Correct face flux phi -= pEqn.flux(); I found that in the code faceHpsi[face] = Upper[face]*psi[u[face]] - Lower[face]*psi[l[face]]; why use this expression to correct face flux? //////////////////////////////////////////////////////////////// Foam::lduMatrix::faceH template Foam::tmp > Foam::lduMatrix::faceH(const Field& psi) const { tmp > tfaceHpsi(new Field (lduAddr().lowerAddr().size())); Field& faceHpsi = tfaceHpsi(); if (lowerPtr_ || upperPtr_) { const scalarField& Lower = const_cast(*this).lower(); const scalarField& Upper = const_cast(*this).upper(); // Take refereces to addressing const unallocLabelList& l = lduAddr().lowerAddr(); const unallocLabelList& u = lduAddr().upperAddr(); for (register label face=0; face::zero; } return tfaceHpsi; } //////////////////////////////////////////////////////////////// fumiya likes this.

 September 23, 2009, 04:41 #2 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,893 Rep Power: 31 Because of consistency: since the pressure equation IS the continuity equation, fuxes must be built in exactly the same way as the pressure matrix coefficients and sources. Work out the maths by hand and you will see that what you need is the off-diagonal pressure coefficient (+ explicit corrections, eg. non-orthogonality, which are treated separately). Hope this helps, Hrv fumiya and atulkjoy like this. __________________ Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

 September 23, 2009, 09:00 #3 New Member   Yijin Li Join Date: Mar 2009 Posts: 13 Rep Power: 15 Thank you for your help. I see. atulkjoy likes this.