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

Foam::lduMatrix::faceH

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By yijin_li
  • 2 Post By hjasak
  • 1 Post By yijin_li

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2009, 06:21
Default Foam::lduMatrix::faceH
  #1
New Member
 
Yijin Li
Join Date: Mar 2009
Posts: 13
Rep Power: 17
yijin_li is on a distinguished road
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<class Type>
Foam::tmp<Foam::Field<Type> >
Foam::lduMatrix::faceH(const Field<Type>& psi) const
{
tmp<Field<Type> > tfaceHpsi(new Field<Type> (lduAddr().lowerAddr().size()));
Field<Type>& faceHpsi = tfaceHpsi();

if (lowerPtr_ || upperPtr_)
{
const scalarField& Lower = const_cast<const lduMatrix&>(*this).lower();
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();

// Take refereces to addressing
const unallocLabelList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr();

for (register label face=0; face<l.size(); face++)
{
faceHpsi[face] = Upper[face]*psi[u[face]]
- Lower[face]*psi[l[face]];
}
}
else
{
// No off-diagonal. Bug fix for conjugate matrices. HJ, 27/Nov/2008
faceHpsi = pTraits<Type>::zero;
}

return tfaceHpsi;
}
////////////////////////////////////////////////////////////////
fumiya likes this.
yijin_li is offline   Reply With Quote

Old   September 23, 2009, 04:41
Default
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   September 23, 2009, 09:00
Default
  #3
New Member
 
Yijin Li
Join Date: Mar 2009
Posts: 13
Rep Power: 17
yijin_li is on a distinguished road
Thank you for your help.

I see.
atulkjoy likes this.
yijin_li 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



All times are GMT -4. The time now is 00:01.