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

Using adjustableTimeStep in pisoFoam

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

Like Tree7Likes
  • 2 Post By odellar
  • 1 Post By sfmoabdu
  • 1 Post By clapointe
  • 2 Post By amuzeshi
  • 1 Post By sourav90

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2014, 03:33
Default Using adjustableTimeStep in pisoFoam
  #1
Member
 
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 10
odellar is on a distinguished road
Hi,

I've found a couple of pages online documenting where to add code in the pisoFoam solver code such that using:

Code:
adjustTimeStep  yes;

maxCo         1;

maxDeltaT    0.5;
in the controlDict file will work (as the pisoFoam doesn't originally support adjustable timestep) - but it's still not particularly clear.

For a start I don't actually know how to get to the solver.c file (which I believe is where I need to add code?)

If anyone could give me some step-by-step instructions of exactly what to do that would be much appreciated.

Thanks, Olie
amuzeshi and sourav90 like this.
odellar is offline   Reply With Quote

Old   February 26, 2014, 08:06
Default Update
  #2
Member
 
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 10
odellar is on a distinguished road
If it helps, I *think* I've put the right code in the right place within pisoFoam.C, thanks to this tutorial: http://www.idurun.com/?p=371

This involved me editing the pisoFoam.C file using
Code:
sudo gedit pisoFoam.C
as it initially told me I don't have permission for some reason. But when I try to compile it using
Code:
wmake
I get this:

Code:
mkdir: cannot create directory `linux64GccDPOpt': Permission denied
/bin/sh: 1: cannot create linux64GccDPOpt/options: Directory nonexistent
make: *** [linux64GccDPOpt/options] Error 2
/opt/openfoam221/wmake/MakefileFiles:40: linux64GccDPOpt/options: No such file or directory
make: *** No rule to make target `linux64GccDPOpt/options'. Stop.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created in /opt/openfoam221/applications/solvers/incompressible/pisoFoam
Any ideas?

Thanks


odellar is offline   Reply With Quote

Old   June 1, 2014, 14:06
Default
  #3
New Member
 
Join Date: Feb 2014
Posts: 9
Rep Power: 9
sfmoabdu is on a distinguished road
it may be too late to reply but let me do it just for anyone will have the same problem.
adding adjustable time step to pisoFoam is not that big issue, just google the tutorial "adding temprature to icofoam" and instead of temprature you will add two headers in the pisoFoam.C (or whatever you will call it)

After:
# include "initContinuityErrs.H"
add this:
# include "readTimeControls.H"

and after:
# include "CourantNo.H"
add this:
# include "setDeltaT.H"

and run wmake.

in system/controlDict add these lines.

adjustTimeStep on;
maxCo 0.3;

and in fvSchemes add linear as following:

interpolationSchemes
{
default linear;
.
.
.
}

Enjoy!!
rajibroy likes this.
sfmoabdu is offline   Reply With Quote

Old   April 13, 2018, 06:48
Default
  #4
New Member
 
Ben
Join Date: Oct 2016
Posts: 25
Rep Power: 6
bentkj is on a distinguished road
Quote:
Originally Posted by sfmoabdu View Post
it may be too late to reply but let me do it just for anyone will have the same problem.
adding adjustable time step to pisoFoam is not that big issue, just google the tutorial "adding temprature to icofoam" and instead of temprature you will add two headers in the pisoFoam.C (or whatever you will call it)

After:
# include "initContinuityErrs.H"
add this:
# include "readTimeControls.H"

and after:
# include "CourantNo.H"
add this:
# include "setDeltaT.H"

and run wmake.

in system/controlDict add these lines.

adjustTimeStep on;
maxCo 0.3;

and in fvSchemes add linear as following:

interpolationSchemes
{
default linear;
.
.
.
}

Enjoy!!
Hi, sorry if this is late but after I add the 2 headers and do wmake, i get the errors:

Quote:
Making dependency list for source file my_pisoFoam.C
g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam4/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam4/src/TurbulenceModels/incompressible/lnInclude -I/opt/openfoam4/src/transportModels -I/opt/openfoam4/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam4/src/finiteVolume/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -I/opt/openfoam4/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c my_pisoFoam.C -o Make/linux64GccDPInt32Opt/my_pisoFoam.o
In file included from my_pisoFoam.C:57:0:
/opt/openfoam4/src/finiteVolume/lnInclude/readTimeControls.H: In function ‘int main(int, char**)’:
/opt/openfoam4/src/finiteVolume/lnInclude/readTimeControls.H:32:1: error: ‘adjustTimeStep’ was not declared in this scope
adjustTimeStep =
^
/opt/openfoam4/src/finiteVolume/lnInclude/readTimeControls.H:35:1: error: ‘maxCo’ was not declared in this scope
maxCo =
^
/opt/openfoam4/src/finiteVolume/lnInclude/readTimeControls.H:38:1: error: ‘maxDeltaT’ was not declared in this scope
maxDeltaT =
^
/opt/openfoam4/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/my_pisoFoam.o' failed
make: *** [Make/linux64GccDPInt32Opt/my_pisoFoam.o] Error 1
any idea?

*EDIT: turns out another header file was missing. this is #include "createTimeControls.H"
adding that in solved the problem. Thank you.

Source: Error trying to compile new solver.C
bentkj is offline   Reply With Quote

Old   November 13, 2018, 20:50
Default
  #5
New Member
 
caoxuxiang's Avatar
 
Xuxiang Cao
Join Date: Jun 2016
Posts: 9
Rep Power: 7
caoxuxiang is on a distinguished road
Quote:
Originally Posted by bentkj View Post
Hi, sorry if this is late but after I add the 2 headers and do wmake, i get the errors:



any idea?

*EDIT: turns out another header file was missing. this is #include "createTimeControls.H"
adding that in solved the problem. Thank you.

Source: Error trying to compile new solver.C
i have the same problem now. maybe i can give you some advices. when i found the pisoFoam.c, there no # include "readTimeControls.H" and # include "setDeltaT.H" . i just done the same steps as you, then i got wrong information too.

“the variable was not declared” is tell me that it was not declared before to use it. so i added the #include "createTimeControls.H" after #include "createControl.H", it works well.

p.s of-4.0
caoxuxiang is offline   Reply With Quote

Old   November 14, 2018, 14:20
Default
  #6
Senior Member
 
Join Date: Aug 2015
Posts: 492
Rep Power: 12
clapointe is on a distinguished road
For future reference, pimpleFoam can be run essentially as pisoFoam by setting nOuterCorrectors to 1. This alleviates any coding problem. pimpleFoam supports adjustable timestep.

Caelan
utkunun likes this.
clapointe is offline   Reply With Quote

Old   September 30, 2020, 10:14
Default
  #7
Senior Member
 
Ali Shayegh
Join Date: Oct 2015
Posts: 124
Rep Power: 8
amuzeshi is on a distinguished road
Quote:
Originally Posted by odellar View Post
Hi,

I've found a couple of pages online documenting where to add code in the pisoFoam solver code such that using:

Code:
adjustTimeStep  yes;

maxCo         1;

maxDeltaT    0.5;
in the controlDict file will work (as the pisoFoam doesn't originally support adjustable timestep) - but it's still not particularly clear.

For a start I don't actually know how to get to the solver.c file (which I believe is where I need to add code?)

If anyone could give me some step-by-step instructions of exactly what to do that would be much appreciated.

Thanks, Olie
Hi,
In order to make it possible to use adjustable time step in pisoFoam, in OpenFOAM v2006, follow these steps:
Code:
mkdir -p  $WM_PROJECT_USER_DIR/solvers/incompressible
cp -r $FOAM_SOLVERS/incompressible/pisoFoam  $WM_PROJECT_USER_DIR/solvers/incompressible/myPisoFoam
cd $WM_PROJECT_USER_DIR/solvers/incompressible/myPisoFoam
mv pisoFoam myPisoFoam
sed -i s/pisoFoam/myPisoFoam/g Make/files
Then add the red lines to myPisoFoam.C:
Code:
...
    #include "createFields.H"								   
    #include "initContinuityErrs.H"							  
    #include "CourantNo.H"							    
    #include "createTimeControls.H"						    
    #include "setInitialDeltaT.H"
...
	Info<< "Time = " << runTime.timeName() << nl << endl;				      

        #include "CourantNo.H"								        
	#include "setDeltaT.H"
...
Now execute:
Code:
wclean
wmake
Make sure that you are in myPisoFoam directory when you issue these two commands.

Ali
mm66 and sourav90 like this.
amuzeshi is offline   Reply With Quote

Old   February 23, 2021, 11:03
Smile Small correction
  #8
Member
 
Sourav Mandal
Join Date: Jul 2019
Posts: 40
Rep Power: 4
sourav90 is on a distinguished road
Quote:
Originally Posted by amuzeshi View Post
Hi,
In order to make it possible to use adjustable time step in pisoFoam, in OpenFOAM v2006, follow these steps:
Code:
mkdir -p  $WM_PROJECT_USER_DIR/solvers/incompressible
cp -r $FOAM_SOLVERS/incompressible/pisoFoam  $WM_PROJECT_USER_DIR/solvers/incompressible/myPisoFoam
cd $WM_PROJECT_USER_DIR/solvers/incompressible/myPisoFoam
mv pisoFoam.C myPisoFoam.C
sed -i s/pisoFoam/myPisoFoam/g Make/files
...

Ali
Hi Ali & others, thanks very much for adding this . I confirm this works with openFOAM version 8 also, but with the small modification of the commands shown in green.
amuzeshi likes this.
sourav90 is offline   Reply With Quote

Reply

Tags
adjusttimestep, cfl, pisofoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
why pisoFoam take such a long time to converge? izna OpenFOAM Running, Solving & CFD 51 October 25, 2013 02:28
Error DURING pisoFoam execution Pj. OpenFOAM Running, Solving & CFD 0 September 14, 2013 04:28
Differences in solution method for pisoFoam and buoyantBoussinesqPisoFoam mchurchf OpenFOAM 6 September 10, 2013 23:24
pisoFoam, pimpleFoam - Fluent user's questions RodriguezFatz OpenFOAM Running, Solving & CFD 0 September 4, 2013 04:26
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 17:18


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