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

Restart InterDymFoam simulation from latestTime

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 8, 2019, 03:58
Default Restart InterDymFoam simulation from latestTime
  #1
New Member
 
Giovanni
Join Date: Feb 2018
Posts: 2
Rep Power: 0
Giovanni_Do is on a distinguished road
Hello everyone, let me introduce myself, my name is Giovanni and I am a OpenFoam user for just over a year and I am dealing with hull resistance forecasting for planing boats so I refer to the InterDymFoam solver.
I rely on the CINECA processors, and I write to you as I am having problems relaunching simulations from the last moments saved in the various "Processor" folders to complete the preset simulation time.
There is a maximum rental time of the CINECA processors of 24 hours, and I am writing to ask you if you can tell me how I can do to restart the simulations because often the 24 hours are not enough for me.

I forward you my initial script:

rm -r 0
mkdir 0
cp -r 0.orig / * 0 /
setFields
if [$ # -eq 1]; then
Nproc = $ 1
echo "Number of Processors to use:" $ NProc
echo "numberOfSubdomains $ NProc;" > system / nproc
rm -r postProcessing
decomposePar -force
mpirun -np $ NProc interDyMFoam -parallel
reconstructPar -latestTime
else
echo "Number of Processors to use: Serial"
rm -r postProcessing
interDyMFoam
fi


To which I made the following changes for the raise:

# rm -r 0
# mkdir 0
# cp -r 0.orig / * 0 /
# setFields
if [$ # -eq 1]; then
Nproc = $ 1
echo "Number of Processors to use:" $ NProc
echo "numberOfSubdomains $ NProc;" > system / nproc
# rm -r postProcessing
# decomposePar -force
mpirun -np $ NProc interDyMFoam -parallel
reconstructPar -latestTime
else
echo "Number of Processors to use: Serial"
rm -r postProcessing
interDyMFoam
fi

and this is the "ControlDict" library:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "PuntoRifApplForze"
application interDyMFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 24;

deltaT 1e-6;

writeControl adjustableRunTime;

writeInterval 3;

purgeWrite 0;

writeFormat binary;//ascii; //

writePrecision 6;

writeCompression compressed;//uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

adjustTimeStep yes;

maxCo 5;
maxAlphaCo 2;
maxDeltaT 0.01;

functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so");
patches ("fiancoalto" "fiancobassofondo" "pattino" "skeg" "pontepoppa" "timone" "piattello");
p p; // Not required (default p)
U U; // Not required (default U)
log true;
rho rho; // Not required (default rho) if rho is not calculated insert rhoInf
rhoInf 998.2072; // Reference density, fluid
CofR $CorF; // Origin for moment calculations
writeControl timeStep;
writeInterval 1;
}

forza_timone
{
type forces;
functionObjectLibs ("libforces.so");
patches ("timone");
p p; // Not required (default p)
U U; // Not required (default U)
log true;
rho rho; // Not required (default rho) if rho is not calculated insert rhoInf
rhoInf 998.2072; // Reference density, fluid
CofR $CorF; // Origin for moment calculations
writeControl timeStep;
writeInterval 1;
}

};

With this configuration the simulation restarts at the last saved instant, but the deltaT turns out to be considerably smaller than that of the last instant saved before the raise, leading to the explosion of the calculation and to the stop of the simulation

Thank you.
Giovanni_Do is offline   Reply With Quote

Old   April 11, 2019, 03:25
Default
  #2
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 137
Rep Power: 19
JNSN is on a distinguished road
Hi Giovanni,


I have not tested, but I am quite sure your restart problems are related to a bug in reconstructPar tool (see https://bugs.openfoam.org/view.php?id=2832 ). So you have different options:
  1. In case you restart with same number of processors, there is no need to reconstruct/decompose. Just restart from latest time
  2. If you change the number of processors, remove Uf in the latest time folder, before decomposing
  3. Swith to a recenct commit of OpenFOAM-dev, where the issue is fixed: https://github.com/OpenFOAM/OpenFOAM...2c95cdb86268a7
By the way, no need to remove the postProcessing folder, when you restart a case.


Hope this helps,
Jan
JNSN is offline   Reply With Quote

Old   April 11, 2019, 05:22
Default
  #3
New Member
 
Giovanni
Join Date: Feb 2018
Posts: 2
Rep Power: 0
Giovanni_Do is on a distinguished road
Hi JNSN,
I thank you for the complete answer.
I solved thanks to your help and adopting the 4.1 version.
Thanks again,
kind regards,
Giovanni Donà
Giovanni_Do is offline   Reply With Quote

Reply


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
Problem with restart in FSI unsteady simulation david_mocholi SU2 1 June 24, 2023 06:06
Mapping Field Data for Mesh Regions from Another Simulation veterator OpenFOAM Pre-Processing 1 July 10, 2018 05:28
Restart to adjoint for Unsteady Turbulence Cylinder flow yweng3 SU2 0 October 7, 2016 14:50
restart the simulation kmgraju CFX 2 November 21, 2013 08:27
Error when restart simulation zebu83 OpenFOAM 0 October 20, 2009 04:30


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