
[Sponsors] 
Creating a solver for the nondimensionalized NavierStokes equation 

LinkBack  Thread Tools  Display Modes 
November 16, 2012, 13:01 

#21 
Member
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 80
Rep Power: 6 
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 

November 16, 2012, 13:04 

#22 
Member
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 80
Rep Power: 6 
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/i386linuxgnu/libc.so.6" #6 in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/myIcoFoamB" Aborted (core dumped) ubuntu@ubuntuVirtualBox:~/OpenFOAM/mehrez2.1.1/test/cavity$ 

November 16, 2012, 13:10 

#23 
Member
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 80
Rep Power: 6 
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.17543e06, No Iterations 17 DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 3.68856e06, 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/i386linuxgnu/libc.so.6" #6 in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/myIcoFoamB" Aborted (core dumped) ubuntu@ubuntuVirtualBox:~/OpenFOAM/mehrez2.1.1/test/cavity$ 

November 16, 2012, 13:24 

#24 
Member
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 80
Rep Power: 6 
Any idea ? does someone know how to ignore the dimensionchecking in the "controlDict" file ?
I'm stuck... 

November 16, 2012, 15:17 

#26  
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 14 
Quote:
cd $FOAM_INST_DIR/OpenFOAM2.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 homedirectory. Good luck, I hope this works. 

November 19, 2012, 05:36 

#27 
Member
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 80
Rep Power: 6 
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. 

November 19, 2012, 05:55 

#28 
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 251
Blog Entries: 10
Rep Power: 10 
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 

November 19, 2012, 06:16 

#29 
Member
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 80
Rep Power: 6 
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 

November 19, 2012, 06:32 

#30 
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 251
Blog Entries: 10
Rep Power: 10 
You can edit the system/fvSchemes from:
Code:
ddtSchemes { default Euler; } Code:
ddtSchemes { default steadyState; } Regards, Hisham 

November 19, 2012, 11:04 

#32 
Member
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 80
Rep Power: 6 
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 steadystate 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 steadystate, incompressible flow. " So, to implement a solver that resolves the following equation (steadystate) : 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 

November 19, 2012, 16:16 

#33 
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 251
Blog Entries: 10
Rep Power: 10 
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 

November 19, 2012, 19:38 

#34 
Member
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 80
Rep Power: 6 
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 

November 20, 2012, 04:28 

#35 
Senior Member

Hi,
did you see http://openfoamextend.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 

December 17, 2012, 11:46 

#36 
Member
Sami
Join Date: Nov 2012
Location: Cap Town, South Africa
Posts: 80
Rep Power: 6 
Thank you elvis


May 9, 2013, 10:53 

#37 
New Member
OFghost
Join Date: Feb 2013
Location: Canada
Posts: 8
Rep Power: 6 
Hi,
I am having the similar problem, please help me to deal with. Thanks 

December 11, 2016, 19:04 
How to turn off the dimension checking in OpenFOAM

#38  
Senior Member
Bill Wang
Join Date: Aug 2014
Posts: 104
Rep Power: 4 
Quote:
I have copied the controlDict out into the case folder, and changed the dimensionSet from 1 to 0, since I have no permission to change the original local file. But still an error occurs: Code:
cellSource functionObjects_allvolAverage:All(): total cells =103462 total volume = 0.0400007 Time=0.0125 Courant Number mean:0 max:0 >FOAM FATAL IO ERROR: incompatible dimensions for operation [U[0 0 1 0 0 0 0]]+ [U[0 0 1 0 0 0 0]] From function checkMethod (const fcMatrix<Type>&, const fvMatrix<Type>&) in file /usr/local/OpenFOAM/OpenFOAM3.0.1/src/finiteVolume/lnInclude/fcMatrix.C at line 1295. FOAM aborting #0 Foam::error:rintStack(Foam::Ostream&) at ??:? # Foam::IOerror::abort() at ??:? #2 void Foam::checkMethod<Foam::Vector<double>>(Foam::fvMatrix<Foam::Vector<double>> const&, Foam::fvMatrix<Foam::Vector<double>> const&, char const*) at ??:? #3 ? at ??:? #4 ? at ??:? #5 __libc_start_main in "/lib/x86_64linuxgnu/libc.so.6" #6 ? at ??:? Aborted It seems that the newly created solver does not listen to the modified controDict file. I am really appreciated for any suggestions. Thank you in advance. Best Regards, Bill 

December 12, 2016, 14:20 
Why create a nondimensional solver for NS? Use the existing ones!

#39 
Member
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 54
Rep Power: 6 
Ok, let me leave you some comments about what you are trying to do:
(1) It seems to me that you are trying to solve the equations directly! But as you are currently implementing it will certainly diverge (even if you make it compile) because you are not giving an equation for p (the system is illposed), simply as that. Refer to a basic text of CFD to get acquainted with different solution algorithms. The book of Peyret is a nice introduction to the subject. (2) You don't need this at all! If you choose the natural frequency of the system to be U/L then the dimensional and nondimensional version of the NS eqns are equivalent, except that the viscous diffusivity multiplying the laplacian term becomes the inverse of the Reynolds number. In other words, when asked for nu in 'transportProperties' you insert 1/Re. No need to play with the dimensions either! PISO/SIMPLE doesn't care (should it?), but FOAM does dimension checking as a convenience for the user and the developer. TL;DR: Don't bother implementing a new solver, just use ico/simple/pisoFoam considering nu equal to the inverse of Reynolds number, unless the natural freq. of the system is given at the boundaries. Last edited by Santiago; December 12, 2016 at 14:27. Reason: EDIT: Clarified solvers 

December 12, 2016, 15:18 
the detailed descripition about the problem

#40  
Senior Member
Bill Wang
Join Date: Aug 2014
Posts: 104
Rep Power: 4 
Quote:
Thank you for the comments, I have described the problem detailly here, with the related equations and the decomposed pressure. How to use the dimensionless NS equations in OpenFOAM This thread may help to explain my problem. Thank you for the help. Cheers, Bill 

Tags 
navierstokes solver, openfoam 
Thread Tools  
Display Modes  


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 01:06 
test prob for 2D unsteady navier stokes equation  Shah  Main CFD Forum  5  April 20, 2007 07: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 05:45 