CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Solving stokes flow (https://www.cfd-online.com/Forums/openfoam-programming-development/199706-solving-stokes-flow.html)

palarcon March 13, 2018 07:53

Solving stokes flow
 
Good afternoon

I'm a new programmer into OpenFOAM, and as a part of a larger development project, I want to start coding the Stokes flow (meaning steady state, without convection term, no body forces and laminar flow).
To do so, I started with icoFoam.C and then I implemented the SIMPLE algorithm from the description found on the OpenFOAM wiki

https://openfoamwiki.net/index.php/O...hm_in_OpenFOAM

I'm not using simpleFoam because I don't need the turbulence either.

While compiling I've got the following two errors, which I think are related to the relaxation needed in the SIMPLE algorithm because icoFoam don't need that, but I have no idea how to fix that.

error: ‘class Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > >’ has no member named ‘relax’
UEqn.relax();

error: passing ‘const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary’ as ‘this’ argument discards qualifiers [-fpermissive]
p.boundaryField().updateCoeffs();

The beginning of my code is:

Code:

#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "simpleControl.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"

simpleControl simple(mesh);



All times are GMT -4. The time now is 23:10.