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

interFoam's UEqn.

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By eysteinn
  • 1 Post By akidess

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2013, 10:03
Default interFoam's UEqn.
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18
sharonyue is on a distinguished road
Hi guys,

In thies UEqn we have:

Code:
solve
        (
            UEqn
         ==
            fvc::reconstruct
            (
                (
                    fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
                  - ghf*fvc::snGrad(rho)
                  - fvc::snGrad(p_rgh)
                ) * mesh.magSf()
            )
        );
Can I code it like this:

Code:
solve
        (
            UEqn
         ==
            
                    interface.sigmaK()*fvc::grad(alpha1)
                  - ghf*fvc::grad(rho)
                  - fvc::grad(p_rgh)
        );
Actually Im confused about the difference with the grad() and sngrad(). Any ideas?
Attached Images
File Type: jpg 1.jpg (12.8 KB, 72 views)
sharonyue is offline   Reply With Quote

Old   September 10, 2013, 13:34
Default
  #2
Member
 
Eysteinn Helgason
Join Date: Sep 2009
Location: Gothenburg, Sweden
Posts: 53
Rep Power: 17
eysteinn is on a distinguished road
Quote:
Originally Posted by sharonyue View Post
Hi guys,

In thies UEqn we have:

Code:
solve
        (
            UEqn
         ==
            fvc::reconstruct
            (
                (
                    fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
                  - ghf*fvc::snGrad(rho)
                  - fvc::snGrad(p_rgh)
                ) * mesh.magSf()
            )
        );
Can I code it like this:

Code:
solve
        (
            UEqn
         ==
            
                    interface.sigmaK()*fvc::grad(alpha1)
                  - ghf*fvc::grad(rho)
                  - fvc::grad(p_rgh)
        );
Actually Im confused about the difference with the grad() and sngrad(). Any ideas?
grad() is the "normal" gradient calculated in the cell center while sngrad()
is the surface normal gradient that is defined on the face of the cell.
(Which explains why interface.sigmaK is interpolated from the cell center
to the face before performing the multiplication.)

fvc::reconstruct reconstructs the cell centered values from the face values.

Hope this helps

/Eysteinn
sharonyue likes this.
eysteinn is offline   Reply With Quote

Old   September 12, 2013, 23:10
Default
  #3
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18
sharonyue is on a distinguished road
Quote:
Originally Posted by eysteinn View Post
grad() is the "normal" gradient calculated in the cell center while sngrad()
is the surface normal gradient that is defined on the face of the cell.
(Which explains why interface.sigmaK is interpolated from the cell center
to the face before performing the multiplication.)

fvc::reconstruct reconstructs the cell centered values from the face values.

Hope this helps

/Eysteinn
Hi,

I tried to revise it into this:
Code:
if (pimple.momentumPredictor())
    {
        solve
        (
            UEqn
         ==
                    interface.sigmaK()*fvc::grad(alpha1)
                  - gh*fvc::grad(rho)
                  - fvc::grad(p_rgh)               
        );
    }
Then wmake successfully, Then I made a test on dambreak, I get the totally same result(see the log). So it works, but I dont know why Weller make it interpolating U then reconstruct it, it would be easy in my way.
Attached Files
File Type: h myUeqnlog.h (7.7 KB, 16 views)
File Type: h orginallog.h (7.7 KB, 6 views)
sharonyue is offline   Reply With Quote

Old   September 13, 2013, 07:11
Default
  #4
Member
 
Eysteinn Helgason
Join Date: Sep 2009
Location: Gothenburg, Sweden
Posts: 53
Rep Power: 17
eysteinn is on a distinguished road
I have not used this solver, but my (wild) guess is that this is used to resolve some
convergence problems with the momentum equation.

When you ran the cavity case was the momentumPredictor set to yes
under pimple in the system/fvSolution?

/Eysteinn
eysteinn is offline   Reply With Quote

Old   September 15, 2013, 21:17
Default
  #5
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18
sharonyue is on a distinguished road
Quote:
Originally Posted by eysteinn View Post
I have not used this solver, but my (wild) guess is that this is used to resolve some
convergence problems with the momentum equation.

When you ran the cavity case was the momentumPredictor set to yes
under pimple in the system/fvSolution?

/Eysteinn
Sorry, I did not, so the log is absolutely the same. While I tried to set it to yes, but the result is almost the same. not differ much.
sharonyue is offline   Reply With Quote

Old   July 9, 2016, 06:43
Default
  #6
Member
 
Hao Chen
Join Date: Aug 2014
Posts: 66
Rep Power: 0
hchen is on a distinguished road
Hi

I am also curious about it. Anybody has a comment on this issue?
hchen is offline   Reply With Quote

Old   July 11, 2016, 03:36
Default
  #7
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Using cell centered values is not consistent and can lead to problems. I think you can find details in S. S. Deshpande, L. Anumolu, and M. F. Trujillo, Computational Science & Discovery 5, 014016+ (2012), ISSN 1749-4699, URL http://dx.doi.org/10.1088/1749-4699/5/1/014016. (which anyone working with interFoam should read).
Saturne_User likes this.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
A question about UEqn sonicFoam lfgmarc OpenFOAM Programming & Development 6 February 1, 2015 17:49
About UEqn in icoFoam. sharonyue OpenFOAM Programming & Development 11 July 3, 2013 00:44
Difference between UEqn in sonicFoam & Theory sasanghomi OpenFOAM Programming & Development 9 June 27, 2013 05:12
Adding an explicit source term in the UEqn() Anne Lincke OpenFOAM Running, Solving & CFD 0 June 25, 2013 13:19
Source term problem in UEqn of simpleFoam fisch OpenFOAM Programming & Development 1 June 17, 2011 11:57


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