|
[Sponsors] |
February 26, 2014, 03:33 |
Using adjustableTimeStep in pisoFoam
|
#1 |
Member
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 12 |
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; 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 |
|
February 26, 2014, 08:06 |
Update
|
#2 |
Member
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 12 |
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 Code:
wmake 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 Thanks |
|
June 1, 2014, 14:06 |
|
#3 |
New Member
Join Date: Feb 2014
Posts: 9
Rep Power: 12 |
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!! |
|
April 13, 2018, 06:48 |
|
#4 | ||
New Member
Ben
Join Date: Oct 2016
Posts: 25
Rep Power: 9 |
Quote:
Quote:
*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 |
|||
November 13, 2018, 20:50 |
|
#5 | |
New Member
Xuxiang Cao
Join Date: Jun 2016
Posts: 11
Rep Power: 10 |
Quote:
“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 |
||
November 14, 2018, 14:20 |
|
#6 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
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 |
|
September 30, 2020, 10:14 |
|
#7 | |
Senior Member
Ali Shayegh
Join Date: Oct 2015
Posts: 131
Rep Power: 11 |
Quote:
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 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" ... Code:
wclean wmake Ali |
||
February 23, 2021, 11:03 |
Small correction
|
#8 | |
Member
Sourav Mandal
Join Date: Jul 2019
Posts: 55
Rep Power: 7 |
Quote:
|
||
October 14, 2022, 18:19 |
|
#9 |
Member
Neilson Whit
Join Date: Aug 2011
Posts: 74
Rep Power: 15 |
It gives me following error: Any idea?
Code:
/home/kano/OpenFOAM/OpenFOAM-10/src/finiteVolume/lnInclude/setDeltaT.H: In function int main(int, char**): /home/kano/OpenFOAM/OpenFOAM-10/src/finiteVolume/lnInclude/setDeltaT.H:37:34: error: expected primary-expression before . token 37 | deltaT = min(deltaT, fvModels.maxDeltaT()); | ^ make: *** [/home/kano/OpenFOAM/OpenFOAM-10/wmake/rules/General/transform:26: Make/linux64GccDPInt32Debug/mymhdFoam.o] Error 1 |
|
October 26, 2022, 21:00 |
|
#10 | |
Senior Member
Ali Shayegh
Join Date: Oct 2015
Posts: 131
Rep Power: 11 |
Quote:
|
||
October 27, 2022, 04:21 |
|
#11 |
Member
Neilson Whit
Join Date: Aug 2011
Posts: 74
Rep Power: 15 |
||
October 30, 2022, 16:26 |
|
#12 |
Senior Member
Ali Shayegh
Join Date: Oct 2015
Posts: 131
Rep Power: 11 |
||
June 12, 2023, 17:57 |
|
#13 |
New Member
Join Date: Jun 2017
Posts: 15
Rep Power: 9 |
Hi,
I am trying to implement adjustTimeStep in the solver shallowWaterFoam in openFOAM-10, following the instruction from the previous posts. I do the following Code:
mkdir -p $WM_PROJECT_USER_DIR/solvers/incompressible cp -r $FOAM_SOLVERS/incompressible/shallowWater $WM_PROJECT_USER_DIR/solvers/incompressible/myShallowWater cd $WM_PROJECT_USER_DIR/solvers/incompressible/myShallowWater mv shallowWaterFoam.C myShallowWaterFoam.C sed -i s/shallowWaterFoam/myShallowWaterFoam/g Make/files Code:
#include "fvCFD.H" #include "pimpleControl.H" #include "fvModels.H" #include "fvConstraints.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "postProcess.H" #include "setRootCaseLists.H" #include "createTime.H" #include "createMesh.H" #include "createControl.H" #include "createFields.H" #include "CourantNo.H" #include "createTimeControls.H" #include "setInitialDeltaT.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (pimple.loop(runTime)) { Info<< "\n Time = " << runTime.timeName() << nl << endl; #include "CourantNo.H" #include "setDeltaT.H" Code:
wclean wmake Code:
/opt/openfoam10/src/finiteVolume/lnInclude/setDeltaT.H: In function ‘int main(int, char**)’: /opt/openfoam10/src/finiteVolume/lnInclude/setDeltaT.H:37:34: error: expected primary-expression before ‘.’ token 37 | deltaT = min(deltaT, fvModels.maxDeltaT()); | ^ make: *** [/opt/openfoam10/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/myShallowWaterFoam.o] Error 1 Code:
FOAM_APPBIN Code:
FOAM_USER_APPBIN Thank you! Last edited by Simone81; June 12, 2023 at 17:58. Reason: adding OF version. |
|
Tags |
adjusttimestep, cfl, pisofoam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Differences in solution method for pisoFoam and buoyantBoussinesqPisoFoam | mchurchf | OpenFOAM | 7 | August 6, 2023 09:12 |
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 |
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 |