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

Difference between UEqn().H() & UEqn().H1()?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 11, 2014, 08:57
Default Difference between UEqn().H() & UEqn().H1()?
  #1
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Dear Foamers,

what is the difference between UEqn().H() & UEqn().H1() equations?
Tushar@cfd is offline   Reply With Quote

Old   October 13, 2014, 10:30
Smile Hi
  #2
Senior Member
 
Join Date: Sep 2010
Posts: 226
Rep Power: 16
T.D. is on a distinguished road
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.
T.D. is offline   Reply With Quote

Old   October 16, 2014, 08:09
Default
  #3
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Quote:
Hi
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.
Please, excuse for the late reply.

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!
Tushar@cfd is offline   Reply With Quote

Old   October 16, 2014, 08:41
Smile
  #4
Senior Member
 
Join Date: Sep 2010
Posts: 226
Rep Power: 16
T.D. is on a distinguished road
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.

Quote:
Originally Posted by Tushar@cfd View Post
Please, excuse for the late reply.

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!
T.D. is offline   Reply With Quote

Old   October 16, 2014, 08:53
Default
  #5
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
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
Tushar@cfd is offline   Reply With Quote

Old   May 30, 2015, 06:02
Default
  #6
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Quote:
Originally Posted by Tushar@cfd View Post
I am not sure either, but I think it is more related to non-diagonal terms.

Correct me if I am wrong?

-
Best Regards!
Hello guys,

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()
https://github.com/OpenFOAM/OpenFOAM...rix/fvMatrix.C


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...ixOperations.C
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() .
Correct me if im wrong?

Best,
Attached Images
File Type: jpg 1.jpg (10.5 KB, 490 views)
__________________
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.
sharonyue is offline   Reply With Quote

Old   November 9, 2015, 07:32
Default
  #7
Member
 
Alexander
Join Date: Mar 2009
Posts: 49
Rep Power: 17
sahas is on a distinguished road
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
sahas is offline   Reply With Quote

Old   January 2, 2019, 07:17
Default
  #8
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
Here a good explanation of the usage and computation of H1 is given:

http://hobbyfoam.blogspot.com/2016/0...-openfoam.html
mAlletto is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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


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


All times are GMT -4. The time now is 03:08.