|
[Sponsors] |
October 13, 2014, 10:30 |
Hi
|
#2 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 |
Hi,
I think (from some tests that i did) that: H1() is simply the diagonal coeffients divided by the volume and thus it is equal to diag()/mesh.V(). Moreover, it does not contain the contribution of the BC cells. So that's why it is different from A(). H() ? i am not sure, i asked for it too. But, i guess it should be as the following: lets say we want to solve for matrix system: K*psi=S. OpenFoam re-arrange the system as: (A+H')*psi=S with A: diagonal coeffs. H': non-diagonal coeffs., and S: source terms coeffs. Then one can write: A*psi = (S - H'*psi). I think (not sure) that the H() is the one as: H= (S - H'*psi). FOAMERS, Correct me if i am mistaken.. Regards, T.D. |
|
October 16, 2014, 08:09 |
|
#3 | |
Senior Member
|
Quote:
I think, UEqn.H1( ) instead depends on the non-diagonal terms. Or, in more general way it is equal to non-diagonal()/mesh.V(). What do you think? - Best Regards! |
||
October 16, 2014, 08:41 |
|
#4 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 |
Hi,
So what you are saying is that according to my previous posts, it will be: H'= H1() . Foamers, any confirmation (proof) ? Regards, T.D. |
|
October 16, 2014, 08:53 |
|
#5 |
Senior Member
|
I am not sure either, but I think it is more related to non-diagonal terms.
Correct me if I am wrong? - Best Regards! Last edited by Tushar@cfd; October 29, 2014 at 08:50. Reason: incorrect English sentence |
|
May 30, 2015, 06:02 |
|
#6 | |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17 |
Quote:
Cause recently I wanna do a simplecFoam for fun. This may relate to this topic. I tried to search the code, after lots of nested class(right? bad for my english..) I got this: Code:
H1_.internalField() = lduMatrix::H1(); Hphi.internalField() += lduMatrix::H(psi_.internalField()) + source_;//this is for H() Code:
template<class Type> Foam::tmp<Foam::Field<Type> > Foam::lduMatrix::H(const Field<Type>& psi) const { tmp<Field<Type> > tHpsi ( new Field<Type>(lduAddr().size(), pTraits<Type>::zero) ); if (lowerPtr_ || upperPtr_) { Field<Type> & Hpsi = tHpsi(); Type* __restrict__ HpsiPtr = Hpsi.begin(); const Type* __restrict__ psiPtr = psi.begin(); const label* __restrict__ uPtr = lduAddr().upperAddr().begin(); const label* __restrict__ lPtr = lduAddr().lowerAddr().begin(); const scalar* __restrict__ lowerPtr = lower().begin(); const scalar* __restrict__ upperPtr = upper().begin(); register const label nFaces = upper().size(); for (register label face=0; face<nFaces; face++) { HpsiPtr[uPtr[face]] -= lowerPtr[face]*psiPtr[lPtr[face]]; HpsiPtr[lPtr[face]] -= upperPtr[face]*psiPtr[uPtr[face]]; } } return tHpsi; } Foam::tmp<Foam::scalarField > Foam::lduMatrix::H1() const { tmp<scalarField > tH1 ( new scalarField(lduAddr().size(), 0.0) ); if (lowerPtr_ || upperPtr_) { scalarField& H1_ = tH1(); scalar* __restrict__ H1Ptr = H1_.begin(); const label* __restrict__ uPtr = lduAddr().upperAddr().begin(); const label* __restrict__ lPtr = lduAddr().lowerAddr().begin(); const scalar* __restrict__ lowerPtr = lower().begin(); const scalar* __restrict__ upperPtr = upper().begin(); register const label nFaces = upper().size(); for (register label face=0; face<nFaces; face++) { H1Ptr[uPtr[face]] -= lowerPtr[face]; H1Ptr[lPtr[face]] -= upperPtr[face]; } } return tH1; } https://github.com/OpenFOAM/OpenFOAM...rixTemplates.C For now too many codes Im a little dizzy. For my CFD level this is endless to dig deeper... However, I think the main difference is that H() includes the source when U apply FVM discretation on UEqn. But H1() does not. From this equations(No need to post all of it here cuz its chinese), H1() does not consider that source term in Ueqn. I think this is rite from T.D. Code:
So what you are saying is that according to my previous posts, it will be: H'= H1() . Best,
__________________
My OpenFOAM algorithm website: http://dyfluid.com By far the largest Chinese CFD-based forum: http://www.cfd-china.com/category/6/openfoam We provide lots of clusters to Chinese customers, and we are considering to do business overseas: http://dyfluid.com/DMCmodel.html Last edited by sharonyue; May 30, 2015 at 09:15. |
||
November 9, 2015, 07:32 |
|
#7 |
Member
Alexander
Join Date: Mar 2009
Posts: 49
Rep Power: 17 |
Hello!
UEqn().H1() should be sum of all non-diagonal coefficients of matrix not including multiplication by Un, so H1 = sum{An} whereas H = sum{An*Un}+source |
|
January 2, 2019, 07:17 |
|
#8 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15 |
Here a good explanation of the usage and computation of H1 is given:
http://hobbyfoam.blogspot.com/2016/0...-openfoam.html |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] snappyHexMesh and cyclic boundaries | Ruli | OpenFOAM Meshing & Mesh Conversion | 2 | December 9, 2013 07:51 |
Periodic Boundary Condition for upwind difference | yohey44 | Main CFD Forum | 0 | October 27, 2010 14:10 |
[General] paraview - plotting difference to reference data | joewe | ParaView | 0 | August 30, 2010 19:01 |
Difference between scaled residuals and... | Dieter | FLUENT | 0 | April 28, 2006 18:52 |
Fininte difference and Finite element Technique | Mahendra Singh Mehra | FLUENT | 3 | December 23, 2005 00:49 |