Skip to content
Snippets Groups Projects
Commit 45be9bcc authored by sergio's avatar sergio
Browse files

Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

parents b083205d 7e6faf04
Branches
Tags
No related merge requests found
......@@ -25,6 +25,13 @@ Class
Foam::functionObjects::timeControl
Description
Wrapper around functionObjects to add time control.
Adds
- timeStart, timeEnd activation
- deltaT modification to hit writeInterval (note: if adjustableRunTime
also in controlDict this has to be an integer multiple)
- smooth deltaT variation through optional deltaTCoeff parameter
Note
Since the timeIndex is used directly from Foam::Time, it is unaffected
......@@ -85,6 +92,9 @@ class timeControl
//- De-activation time - defaults to VGREAT
scalar timeEnd_;
//- Max time step change
scalar deltaTCoeff_;
//- Number of steps before the dump-time during which deltaT
// may be changed (valid for adjustableRunTime)
label nStepsToStartTimeChange_;
......@@ -103,6 +113,16 @@ class timeControl
label executeTimeIndex_;
// For time-step change limiting (deltaTCoeff supplied) only:
//- Store the old deltaT value
scalar deltaT0_;
//- Store the series expansion coefficient value
scalar seriesDTCoeff_;
// Private Member Functions
//- Read relevant dictionary entries
......@@ -111,6 +131,26 @@ class timeControl
//- Returns true if within time bounds
bool active() const;
//- Return expansion ratio (deltaT change) that gives overall time
static scalar calcExpansion
(
const scalar startRatio,
const scalar y,
const label n
);
//- Calculate deltaT change such that the next write interval is
// obeyed. Updates requiredDeltaTCoeff
void calcDeltaTCoeff
(
scalar& requiredDeltaTCoeff,
const scalar wantedDT,
const label nSteps,
const scalar presentTime,
const scalar timeToNextWrite,
const bool rampDirectionUp
);
//- Disallow default bitwise copy construct
timeControl(const timeControl&);
......
......@@ -89,7 +89,7 @@ bool Foam::functionObjects::setTimeStepFunctionObject::adjustTimeStep()
index = time_.timeIndex();
// Set time, allow deltaT to be adjusted for writeInterval purposes
const_cast<Time&>(time_).setDeltaT(newDeltaT, true);
const_cast<Time&>(time_).setDeltaT(newDeltaT, false);
}
return true;
......
......@@ -43,6 +43,9 @@ Usage
{
type setTimeStep;
libs ("libutilityFunctionObjects.so");
deltaT table ((0 5e-4)(0.01 1e-3));
...
}
\endverbatim
......@@ -52,6 +55,10 @@ Usage
Property | Description | Required | Default value
type | Type name: setTimeStep | yes |
enabled | On/off switch | no | yes
deltaT | Time step value | yes |
timeStart | Start time | no | 0
timeEnd | End time | no | GREAT
deltaTCoeff | Time step change limit | no | GREAT
\endtable
SourceFiles
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment