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

interFoam's UEqn.

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

Like Tree1Likes
  • 1 Post By eysteinn

Reply
 
LinkBack Thread Tools Display Modes
Old   September 10, 2013, 09:03
Default interFoam's UEqn.
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing,China
Posts: 502
Rep Power: 6
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, 15 views)
sharonyue is offline   Reply With Quote

Old   September 10, 2013, 12:34
Default
  #2
Member
 
Eysteinn Helgason
Join Date: Sep 2009
Location: Gothenburg, Sweden
Posts: 52
Rep Power: 6
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, 22:10
Default
  #3
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing,China
Posts: 502
Rep Power: 6
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, 5 views)
File Type: h orginallog.h (7.7 KB, 2 views)
sharonyue is offline   Reply With Quote

Old   September 13, 2013, 06:11
Default
  #4
Member
 
Eysteinn Helgason
Join Date: Sep 2009
Location: Gothenburg, Sweden
Posts: 52
Rep Power: 6
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, 20:17
Default
  #5
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing,China
Posts: 502
Rep Power: 6
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

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 11:50.