|
[Sponsors] |
August 2, 2016, 05:01 |
Variable time steps sonicfoam error
|
#1 |
New Member
Join Date: Aug 2016
Posts: 3
Rep Power: 9 |
hi,
i used a modified sonicFoam solver with variable time steps in OpenFOAM 2.4. I modified the solver following this tutorial and everything worked fine. http://www.idurun.com/2008/06/13/run...p-in-openfoam/ I now updated to 4.0 and tried to use my old solver again, but i was not able to compile it. I then started from the standard sonicFOAM solver in 4.0 and added the lines as done before. Im not able to compile it and get the following errors: messnerp@cfeluulacc03:~/Desktop/messnerp/OpenFOAM/solvers/sonicFoam5$ wclean messnerp@cfeluulacc03:~/Desktop/messnerp/OpenFOAM/solvers/sonicFoam5$ wmake Making dependency list for source file sonicFoam5.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/transportModels/compressible/lnInclude -I/opt/openfoam4/src/transportModels/compressible/lnInclude -I/opt/openfoam4/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam4/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam4/src/TurbulenceModels/compressible/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -I/opt/openfoam4/src/sampling/lnInclude -I/opt/openfoam4/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c sonicFoam5.C -o Make/linux64GccDPInt32Opt/sonicFoam5.o In file included from sonicFoam5.C:51: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 = ^ make: *** [Make/linux64GccDPInt32Opt/sonicFoam5.o] Error 1 My code looks the following (i added the red lines): #include "fvCFD.H" #include "psiThermo.H" #include "turbulentFluidThermoModel.H" #include "pimpleControl.H" #include "fvOptions.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "postProcess.H" #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "readTimeControls.H" // added #include "createControl.H" #include "createFields.H" #include "createFieldRefs.H" #include "createFvOptions.H" #include "initContinuityErrs.H" turbulence->validate(); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) // changed from runTime.loop() { Info<< "Time = " << runTime.timeName() << nl << endl; #include "readTimeControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" // added runTime++; // added #include "rhoEqn.H" // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { #include "UEqn.H" #include "EEqn.H" // --- Pressure corrector loop while (pimple.correct()) { #include "pEqn.H" } if (pimple.turbCorr()) { turbulence->correct(); } } rho = thermo.rho(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } // ************************************************** *********************** // I couldnt figure out whats wrong, has the naming mybe changed from OpenFOAM 2.4 to 4.0?? Thanks! |
|
September 9, 2016, 03:21 |
|
#2 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 15 |
For future references:
you should include the following header after createMesh Code:
#include "createTimeControls.H" |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 00:21 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 06:20 |
checking the system setup and Qt version | vivek070176 | OpenFOAM Installation | 22 | June 1, 2010 12:34 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 02:32 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 17:51 |