
[Sponsors] 
Creating a solver for the nondimensionalized NavierStokes equation 

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

#21 
Member
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 80
Rep Power: 5 
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
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 80
Rep Power: 5 
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
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 80
Rep Power: 5 
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
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 80
Rep Power: 5 
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
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 80
Rep Power: 5 
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: 249
Blog Entries: 10
Rep Power: 9 
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
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 80
Rep Power: 5 
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: 249
Blog Entries: 10
Rep Power: 9 
You can edit the system/fvSchemes from:
Code:
ddtSchemes { default Euler; } Code:
ddtSchemes { default steadyState; } Regards, Hisham 

November 19, 2012, 11:04 

#32 
Member
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 80
Rep Power: 5 
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: 249
Blog Entries: 10
Rep Power: 9 
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
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 80
Rep Power: 5 
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
Mehrez
Join Date: Nov 2012
Location: Bordeaux, France
Posts: 80
Rep Power: 5 
Thank you elvis


May 9, 2013, 10:53 

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

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 