|
[Sponsors] |
Can we restart the simulation from a different time in OpenFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 15, 2010, 23:57 |
Can we restart the simulation from a different time in OpenFoam
|
#1 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Dear Foamers,
I was running a simulation till a particular time period, but found that the steady state was not reached. I would like to know, whether I have to rerun my simulations again from the beginning or is it possible to start the simulations from the point where I stopped as the starting value. I was trying to implement this by changing the starting value in controlDict file, but couldnt be of any use. I would appreciate if you guys can throw your suggestions. Thanks Vishal |
|
September 16, 2010, 00:39 |
|
#2 |
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24 |
Yes, it is possible use latestTime in stead of startTime in system/controDict. This info is available in User's Guide.
Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D. Research Scientist Research Center for Computational Methods (CIMEC) - CONICET/UNL Tel: 54-342-4511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe - Argentina. http://www.cimec.org.ar |
|
September 16, 2010, 01:44 |
|
#3 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Dear Santiago,
Thanks for the reply. I did change it in my control dict, but still get the same error. My controlDict initial few lines application eofFoam; startFrom latestTime; latestTime 3e6; stopAt endTime; endTime 6e6; deltaT 200; writeControl timeStep; writeInterval 10000; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression uncompressed; timeFormat general; timePrecision 6; runTimeModifiable yes; Error message: Create time Create mesh for time = 3e+06 Reading field C1 (A) compound has already been transfered from token on line 39689 the empty compound of type List<scalar>#0 Foam::error:rintStack(Foam::Ostream&) in "/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so" #1 Foam::error::abort() in "/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so" #2 Foam::token::transferCompoundToken() in "/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so" #3 Foam::Istream& Foam:perator>><double>(Foam::Istream&, Foam::List<double>&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #4 Foam::Field<double>::Field(Foam::word const&, Foam::dictionary const&, int) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #5 Foam::zeroIonFluxFvPatchScalarField::zeroIonFluxFv PatchScalarField(Foam::fvPatch const&, Foam:imensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #6 Foam::fvPatchField<double>::adddictionaryConstruct orToTable<Foam::zeroIonFluxFvPatchScalarField>::Ne w(Foam::fvPatch const&, Foam:imensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #7 Foam::fvPatchField<double>::New(Foam::fvPatch const&, Foam:imensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #8 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricB oundaryField(Foam::fvBoundaryMesh const&, Foam:imensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #9 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readField(Foam::Istream&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #10 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #11 main in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #12 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6" #13 Foam::regIOobject::readIfModified() in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" From function token::transferCompoundToken() in file lnInclude/token.C at line 96. FOAM aborting Aborted Kindly let me know where I am making an error. Regards Vishal |
|
September 16, 2010, 03:31 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
Code:
startFrom latestTime; Note that this is also the default if the keyword "startFrom" is missing. With this option, you'd simply remove any later results, this will do what you want. The entry Code:
latestTime 3e6; Note, you could also use another alterative combination. For example, Code:
startFrom startTime; startTime 1000; Beyond that I'm not sure what other problem you are encountering. |
||
September 18, 2010, 18:07 |
|
#5 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Dear Santiago
I did try your suggestion again but still get the same error. I would check with the tutorial codes and see if the cavity foam wrks or not. Further, I would like to know if I use probes function to calculate variation a variable with time, is it possible to start dumping the values from a particular start and stop time rather than from time t =0. Kindly throw some light on this. I was searchin this in openFOAM tutorials and other forums but couldn't get any concrete answer. Regards Vishal |
|
September 20, 2010, 10:30 |
|
#6 |
Senior Member
|
I do not know if it is connected to your error message, but:
I did some restarts of different cases. If I restarted from the alst timestep, sometimes some data was missing. Usually everything went fine as soon as I used the last BUT ONE timestep as restarting step. Perhaps it works if you try to restart from 2.99e6 or another value you still have stored inside the simulation folder? |
|
September 20, 2010, 12:31 |
|
#7 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Thanks for the reply Linse, I would try that and would let you know!!
|
|
October 10, 2010, 16:11 |
|
#8 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Dear Foamers,
I did try again to start the simulation from the latest time but still end up with the same error. I was able to run the cavity foam example and it was working fine for that case. Here is a part of my controldict file application eofFoam; startFrom latestTime; latestTime 100; stopAt endTime; endTime 200; deltaT 100; writeControl runTime; writeInterval 100; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression uncompressed; timeFormat general; timePrecision 6; runTimeModifiable yes; I notice that simulation is starting from 100 (initial time) and not from 200 (as deltaT is 100 and latest time is 100). Here is the error message Create time Create mesh for time = 100 Reading field C1 (A) compound has already been transfered from token on line 39689 the empty compound of type List<scalar>#0 Foam::error:rintStack(Foam::Ostream&) in "/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so" #1 Foam::error::abort() in "/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so" #2 Foam::token::transferCompoundToken() in "/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so" #3 Foam::Istream& Foam:perator>><double>(Foam::Istream&, Foam::List<double>&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #4 Foam::Field<double>::Field(Foam::word const&, Foam::dictionary const&, int) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #5 Foam::zeroIonFluxFvPatchScalarField::zeroIonFluxFv PatchScalarField(Foam::fvPatch const&, Foam:imensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #6 Foam::fvPatchField<double>::adddictionaryConstruct orToTable<Foam::zeroIonFluxFvPatchScalarField>::Ne w(Foam::fvPatch const&, Foam:imensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #7 Foam::fvPatchField<double>::New(Foam::fvPatch const&, Foam:imensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #8 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricB oundaryField(Foam::fvBoundaryMesh const&, Foam:imensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #9 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readField(Foam::Istream&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #10 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #11 main in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" #12 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6" #13 Foam::regIOobject::readIfModified() in "/home/vishal/OpenFOAM/vishal-1.5/applications/bin/linuxGccDPOpt/eofFoam" From function token::transferCompoundToken() in file lnInclude/token.C at line 96. FOAM aborting Kindly can anyone provide some help. Thanks Regards Vishal Nandigana |
|
March 7, 2011, 17:34 |
|
#9 |
Member
Join Date: Sep 2010
Posts: 36
Rep Power: 16 |
Hi,
notheless this thread is almost six months old, I wanted to add and clarify that if you are using OF1.7.x, it is not necessary to specify the latestTime per sae. If OF1.7.x is restarted and startFrom latestTime; is specified it will always start from the last solution written in the case folder (either at time 0 or at time latestTime). My controlDict looks like this and is able to restart at any time: Code:
application fireFoam; startFrom latestTime; startTime 0.0; stopAt endTime; endTime 10.0; deltaT 0.001; Last edited by anfho; March 7, 2011 at 18:50. |
|
March 7, 2011, 17:57 |
|
#10 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Thanks Andreas. I was able to solve that issue..
Regards Vishal |
|
March 9, 2011, 13:37 |
|
#11 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
||
March 9, 2011, 14:49 |
|
#12 |
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19 |
Is there an easy way to revert back to an old time during runtime (ie. while the solver is running)?
This way if my solver is becoming unstable due to a time step that is too large, I can go back to the last successful time and pick a smaller time step. |
|
March 9, 2011, 16:43 |
|
#13 | ||
Member
Join Date: Sep 2010
Posts: 36
Rep Power: 16 |
Quote:
Quote:
Regards, Andreas Last edited by anfho; March 9, 2011 at 20:51. |
|||
March 9, 2011, 17:31 |
|
#14 | |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
Quote:
Ben, I do believe that should be possible with some programming work. You have to access the Time object, then you can use either runTime.setTime() to set a specific time or runTime-- to go back one time step. Now, you'll have to make sure that old data is available, by calling setTime for a time you know you wrote data or storing the old time data like done in a SIMPLE style solver. Let me know if it works! Doxygen for Time: http://foam.sourceforge.net/docs/cpp...14f547f414.php |
||
March 9, 2011, 18:18 |
|
#15 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Dear Foamers,
I did change the controlDict file from the latesttime step i had in my simulation for example application coupleFoam; startFrom startTime; startTime 18e6; stopAt endTime; endTime 25e6; deltaT 100; writeControl runTime; writeInterval 1e6; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression uncompressed; timeFormat general; timePrecision 6; runTimeModifiable yes; The problem I was facing was that in the 18e6 folder some variables had non uniform values in the boundary condition that was not deducted by openfoam so I changed those non uniform values to uniform 0 (as once the iteration starts these values will be computed again) Hope this helps Regards Vishal |
|
March 10, 2011, 12:22 |
|
#16 | |
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19 |
Quote:
Code:
if (trouble_flag == 1) { // this will go back to the last good timestep runTime.setTime( runTime.times()[runTime.times().size()-1].value(), runTime.times()[runTime.times().size()-1].value() ); // Now I have to read the values of the last good timestep...what's the best way to do this? fieldName(IOobject("fieldName",runTime.timeName(),mesh,IOobject::MUST_READ,IOobject::AUTO_WRITE),mesh); ... ... //read in all fields ... ... //set a new dt runTime.setDeltaT(someDeltaT); //continue simulation } I think having a feature like this could be very useful to OpenFOAM, I believe most commercial solvers can do this. |
||
March 14, 2011, 09:31 |
|
#17 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
Can you check if this works?
Code:
if (troubleflag == 1) { // this will go back to the last good timestep instant oldtime = runTime.times()[runTime.times().size()]; runTime.setTime( oldtime.value(), runTime.findClosestTimeIndex(runTime.times(), oldtime.value() ) ); //set a new dt runTime.setDeltaT(runTime.deltaT().value() / 2.0); //runTime++ after include of setDeltaT should call objectRegistry::readModifiedObjects(), which in turn should update fields }; |
|
July 22, 2014, 23:25 |
I restart the solution but this error appears
|
#18 |
New Member
Hassan Adel
Join Date: Oct 2013
Location: Egypt
Posts: 18
Rep Power: 13 |
Create time
Create dynamic mesh for time = 0.116 Selecting dynamicFvMesh dynamicMotionSolverFvMesh --> FOAM FATAL IO ERROR: patch 6 not empty type. Patch type = patch file: /home/hassan/foam/foam-extend-3.1/tutorials/solidMechanics/icoFsiElasticNonLinULSolidFoam/HronTurekFsi/fluid/0.116/meshPhi::boundaryField::frontAndBackPlanes from line 41776 to line 41776. From function emptyFvsPatchField<Type>::emptyFvsPatchField ( const fvPatch& p, const Field<Type>& field, const dictionary& dict ) in file fields/fvsPatchFields/constraint/empty/emptyFvsPatchField.C at line 100. FOAM exiting
__________________
H.Elsheshtawy |
|
June 2, 2015, 15:11 |
|
#19 |
New Member
Josh Elliott
Join Date: Feb 2011
Posts: 1
Rep Power: 0 |
Is it possible to start from "t minus 1 timeStep"? With the server I am working with there is a possibility of being forced to shut down my process before completing the latestTime iteration. If that occurs, I want to be able to reboot and the solver should pick up from the last complete time step instead of the latest time step. purgeWrite set to 2, so the last complete iteration is left in the project directory. Any ideas how to start from this timeStep?
|
|
November 30, 2015, 05:03 |
How to restart simulation in Ansys Fluent?
|
#20 |
New Member
parham
Join Date: Oct 2015
Posts: 24
Rep Power: 11 |
Hi all,
I have the same question but in Ansys Fluent. My simulation had run for 3 days, unfortunately it was stopped for obscure reason, thus I have to re-run it again from the last time step. Any help would be appreciated. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 | wyldckat | OpenFOAM Announcements from Other Sources | 3 | September 8, 2010 07:25 |
(chtMultiRegionFoam) reducing gravity increase the simulation time ! | openfoam1 | OpenFOAM | 7 | March 10, 2010 10:41 |
PostChannel | maka | OpenFOAM Post-Processing | 5 | July 22, 2009 10:15 |
influence of time step in insationary simulation | Sascha Behrens | FLUENT | 0 | December 1, 2005 10:08 |