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

Creating a solver for the nondimensionalized Navier-Stokes equation

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

Like Tree9Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   November 16, 2012, 13:01
Default
  #21
Member
 
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 43
Rep Power: 4
Mehrez is on a distinguished road
dimensions [0 0 0 0 0 0 0];

This line represent the dimension of U and p. I have this line in the 2 files cavity/0/p and cavity/0/U
Mehrez is offline   Reply With Quote

Old   November 16, 2012, 13:04
Default
  #22
Member
 
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 43
Rep Power: 4
Mehrez is on a distinguished road
Dear Tobi,

Here is what I got by setting pGrad pGrad [0 -1 0 0 0 0 0]







Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.005

Courant Number mean: 0 max: 0


--> FOAM FATAL ERROR:
incompatible dimensions for operation
[U[0 -1 0 0 0 0 0] ] - [U[0 -2 0 0 0 0 0] ]

From function checkMethod(const fvMatrix<Type>&, const fvMatrix<Type>&)
in file /opt/openfoam211/src/finiteVolume/lnInclude/fvMatrix.C at line 1316.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/myIcoFoamB"
#3
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/myIcoFoamB"
#4
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/myIcoFoamB"
#5 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#6
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/myIcoFoamB"
Aborted (core dumped)
ubuntu@ubuntu-VirtualBox:~/OpenFOAM/mehrez-2.1.1/test/cavity$
Mehrez is offline   Reply With Quote

Old   November 16, 2012, 13:10
Default
  #23
Member
 
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 43
Rep Power: 4
Mehrez is on a distinguished road
Even if I do this, it doesn't work :

0/p
dimensions [0 -1 0 0 0 0 0];

0/U
dimensions [0 0 0 0 0 0 0];

transportProperties
Re Re [ 0 -1 0 0 0 0 0 ] 0.01;
gradP gradP [ 0 -2 0 0 0 0 0 ] (0.9 0.2 0);

This is what I got :






Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.005

Courant Number mean: 0 max: 0
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 6.17543e-06, No Iterations 17
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 3.68856e-06, No Iterations 14


--> FOAM FATAL ERROR:
LHS and RHS of + have different dimensions
dimensions : [0 2 0 0 0 0 0] + [0 4 -1 0 0 0 0]


From function operator+(const dimensionSet&, const dimensionSet&)
in file dimensionSet/dimensionSet.C at line 514.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Foam:perator+(Foam::dimensionSet const&, Foam::dimensionSet const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#3
at myIcoFoamB.C:0
#4
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/myIcoFoamB"
#5 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#6
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/myIcoFoamB"
Aborted (core dumped)
ubuntu@ubuntu-VirtualBox:~/OpenFOAM/mehrez-2.1.1/test/cavity$
Mehrez is offline   Reply With Quote

Old   November 16, 2012, 13:24
Default
  #24
Member
 
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 43
Rep Power: 4
Mehrez is on a distinguished road
Any idea ? does someone know how to ignore the dimension-checking in the "controlDict" file ?

I'm stuck...
Mehrez is offline   Reply With Quote

Old   November 16, 2012, 13:59
Default
  #25
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,000
Blog Entries: 4
Rep Power: 19
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Oh its not my day today, sorry.
Now I understand what you are doing.

Hmmm I have to try it by my self but i have no time. It should be possible.
Tobi is offline   Reply With Quote

Old   November 16, 2012, 15:17
Default
  #26
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Quote:
Originally Posted by Mehrez View Post
Any idea ? does someone know how to ignore the dimension-checking in the "controlDict" file ?

I'm stuck...
If you do
cd $FOAM_INST_DIR/OpenFOAM-2.1.0/etc

You can go to the line with dimensionSet (line 400 for me), and change the switch to 0. I assume this does not check the dimensions, but I am not sure about it.

If you don't have privileges to change that controlDict, you can set it in a .OpenFOAM/2.1.0/ folder in your home-directory.

Good luck, I hope this works.
Mehrez likes this.
Bernhard is offline   Reply With Quote

Old   November 19, 2012, 05:36
Default
  #27
Member
 
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 43
Rep Power: 4
Mehrez is on a distinguished road
Dear both,

It seems that it is working !

Thank you for your precious help.

I hope that this discussion will help other beginners.

Thank you.

Best regards.

Mehrez.
Mehrez is offline   Reply With Quote

Old   November 19, 2012, 05:55
Default
  #28
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 7
Hisham is on a distinguished road
Dear Mehrez

It is nice that your solver is working now. However, I think you better track the dimensions of your equation ... It is a very nice feature to override. Especially, if you have problems with verification of your solver.

Regards,
Hisham
Mehrez likes this.
Hisham is offline   Reply With Quote

Old   November 19, 2012, 06:16
Default
  #29
Member
 
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 43
Rep Power: 4
Mehrez is on a distinguished road
Dear Hisham,

If you look just a little above you will see that I tried to multiply the terms of my equation with coefficients of different dimensions to get a dimensionless form of my equation but it did not work and I do not know why ...

Otherwise I have another question, how to have the steady state? (is not more convenient if I modify another solver like SimpleFoam because removing the line ddt (U) on IcoFoam gives a false result)

thank you

Mehrez
Mehrez is offline   Reply With Quote

Old   November 19, 2012, 06:32
Default
  #30
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 7
Hisham is on a distinguished road
You can edit the system/fvSchemes from:
Code:
ddtSchemes
{
    default         Euler;
}
to:
Code:
ddtSchemes
{
    default         steadyState;
}
But that will just automatically ignore the ddt term. So it has the same shortcoming.

Regards,
Hisham
Hisham is offline   Reply With Quote

Old   November 19, 2012, 09:31
Default
  #31
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 7
Hisham is on a distinguished road
I just remembered. You can also try to base your solver on the pimpleFoam solver, which uses a merge of PISO and SIMPLE algorithms.
Hisham is offline   Reply With Quote

Old   November 19, 2012, 11:04
Default
  #32
Member
 
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 43
Rep Power: 4
Mehrez is on a distinguished road
Hi Hisham,

I've found the following text on the OpenFoam tutorial :

" When specifying a time scheme it must be noted that an application designed for transient problems will not necessarily run as steady-state and visa versa. For example the solution will not converge if steadyState is specified when running icoFoam, the transient, laminar incompressible flow code; rather, simpleFoam should be used for steady-state, incompressible flow. "

So, to implement a solver that resolves the following equation (steady-state) :

fvVectorMatrix UEqn
(
// fvm::ddt(U)
Re*(fvm::div(phi, U))
- fvm::laplacian(U)
+ gradP
);

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

I need to modify the simpleFoam solver rather than icoFoam.


Looking at the simpleFoam solver, I've found 2 files pEqn.H and UEqn.H but I don't know how to modify the equations... can you please tell me what I need to delete (like the turbulence terms).

Thank you.

Best regards.

Mehrez
Mehrez is offline   Reply With Quote

Old   November 19, 2012, 16:16
Default
  #33
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 7
Hisham is on a distinguished road
OpenFOAM solvers use three major algorithms:
- SIMPLE: for steady state (e.g. simpleFoam)
- PISO: for transient problems (e.g. icoFoam and pisoFoam)
- PIMPLE: for steady state and transient because it is a merge of SIMPLE and PISO (e.g. pimpleFoam)

So as I mentioned earlier you need to base your solver on pimpleFoam. When you compare simpleFoam you need to compare it with pisoFoam because both has turbulence modelling while icoFoam has no turbulence modelling capabilities enabled.

Regards,
Hisham
Mehrez likes this.
Hisham is offline   Reply With Quote

Old   November 19, 2012, 19:38
Default
  #34
Member
 
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 43
Rep Power: 4
Mehrez is on a distinguished road
Dear Hisham,

Thank you for your help.

In pimpleFoam there are 2 files to implement my equation : UEqn.H and pEqn.H , so it is different from icoFoam where I had one file to implement the equation.

Can I do some change on the icoFoam solver to be able to solve with pimple algorithm rather than piso ? If not, in which file do I have to put my equation in the pimpleFoam solver ?

Thank you so much for your help and excuse me for these questions.

best regards.

Mehrez
Mehrez is offline   Reply With Quote

Old   November 20, 2012, 04:28
Default
  #35
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 543
Blog Entries: 4
Rep Power: 12
elvis is on a distinguished road
Hi,

did you see http://openfoam-extend.sourceforge.n...m/training.htm
take a look at the tutorials "New Developer"

http://switch.dl.sourceforge.net/pro...he_slides2.pdf
=>start @Slide10 to 19 Copy and rename scalarTransportFoam
Mehrez likes this.
elvis is offline   Reply With Quote

Old   December 17, 2012, 11:46
Default
  #36
Member
 
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 43
Rep Power: 4
Mehrez is on a distinguished road
Thank you elvis
Mehrez is offline   Reply With Quote

Old   May 9, 2013, 11:53
Default
  #37
New Member
 
OFghost
Join Date: Feb 2013
Location: Canada
Posts: 8
Rep Power: 3
umar82088 is on a distinguished road
Hi,
I am having the similar problem, please help me to deal with.
Thanks
umar82088 is offline   Reply With Quote

Reply

Tags
navier-stokes solver, openfoam

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
suGWFoam: Richards equation solver for porous media flows liu OpenFOAM Announcements from Other Sources 0 November 11, 2012 21:09
Navier Stokes solver Siddharth Main CFD Forum 2 September 13, 2007 02:06
test prob for 2D unsteady navier stokes equation Shah Main CFD Forum 5 April 20, 2007 08:25
Navier Stokes Solver Khan Main CFD Forum 2 December 12, 2006 10:41
help: I am trying to solve Navier Stokes compressible and viscid flow Jose Choy Main CFD Forum 2 May 18, 2000 06:45


All times are GMT -4. The time now is 14:20.