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

Navier stoke equation in C++

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 29, 2014, 05:59
Default Navier stoke equation in C++
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
Hi

Any one has template in writing these equations in C++

Thanks in advance
itsme_kit is offline   Reply With Quote

Old   December 1, 2014, 01:52
Default
  #2
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 18
chriss85 will become famous soon enough
Just take a look at a solver that solves a problem similar to your task.
chriss85 is offline   Reply With Quote

Old   December 31, 2014, 08:25
Default
  #3
Member
 
Anil Kunwar
Join Date: Jun 2013
Posts: 64
Rep Power: 11
Annier is an unknown quantity at this point
Hi,
I am replying an answer to this question:
How does the C++ library of OpenFOAM represent Navier-Stokes equation? (I request you to edit your question if it is somewhat like this.)

The OpenFOAM source library describes the Navier-Stokes equation in its applications/solvers.
For examples,
1.In OpenFOAM/OpenFOAM-2.3.x/applications/solvers/incompressible/icoFoam/icoFoam.C, the Navier-Stokes equation is represented as:
Code:
fvVectorMatrix UEqn
        (
            fvm::ddt(U)
          + fvm::div(phi, U)
          - fvm::laplacian(nu, U)
        );

        solve(UEqn == -fvc::grad(p));

//--- PISO LOOP
...
2. Similarly, in OpenFOAM/OpenFOAM-2.3.x/applications/solvers/incompressible/pisoFoam/pisoFoam.C, the Navier-Stokes equation is represented as:
Code:
 // Momentum predictor

            fvVectorMatrix UEqn
            (
                fvm::ddt(U)
              + fvm::div(phi, U)
              + turbulence->divDevReff(U)
            );

            UEqn.relax();

            if (momentumPredictor)
            {
                solve(UEqn == -fvc::grad(p));
            }
//--- PISO LOOP
...
3. ...
4. ...

Yours
Anil Kunwar
Annier 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
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
what is the condition to use the wave equation? mmff Main CFD Forum 0 January 26, 2010 04:25
1-d navier stokes equation Robert Main CFD Forum 0 December 20, 2002 02:14
Navier Stoke mukkarum Main CFD Forum 0 April 1, 2002 23:53


All times are GMT -4. The time now is 06:09.