FSI update: Some modifications to ensure the mesh mover simulator always gets the same time increment as the CFD simulator
git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@1491 e10b68d5-8a6e-419e-a041-bce267b0401d
This commit is contained in:
parent
df54429f90
commit
fbe0de77c5
@ -23,16 +23,12 @@ struct TimeDomain
|
||||
{
|
||||
double t; //!< Current time (or pseudo time, load parameter)
|
||||
double dt; //!< Current time (or load parameter) increment
|
||||
double CFL; //!< Current CFL number (used by CFD simulators)
|
||||
int it; //!< Current iteration within current time/load step
|
||||
bool first; //!< If \e true, this is the first load/time step
|
||||
|
||||
bool useCFL; //!< If timestep limited by CFL
|
||||
double CFL; //!< Current CFL number
|
||||
double maxCFL; //!< CFL restriction
|
||||
|
||||
//! \brief Default constructor.
|
||||
TimeDomain(int i = 0, bool f = true) : it(i), first(f)
|
||||
{ t = dt = CFL = 0.0; maxCFL = 1.0; useCFL = false; }
|
||||
TimeDomain(int i = 0, bool f = true) : it(i), first(f) { t = dt = CFL = 0.0; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
void SIMparameters::initTime (double start, double stop, const TimeSteps& steps)
|
||||
{
|
||||
maxCFL = 0.0;
|
||||
starTime = start;
|
||||
stopTime = stop;
|
||||
mySteps = steps;
|
||||
@ -38,11 +39,10 @@ bool SIMparameters::multiSteps () const
|
||||
|
||||
bool SIMparameters::increment ()
|
||||
{
|
||||
// Adjust timestep according to CFL number
|
||||
if (time.useCFL && time.CFL > 1.0e-12)
|
||||
time.dt = time.maxCFL*time.dt/time.CFL;
|
||||
|
||||
if (stepIt != mySteps.end())
|
||||
if (maxCFL > 0.0 && time.CFL > 1.0e-12)
|
||||
// Adjust time step size according to CFL number
|
||||
time.dt *= maxCFL/time.CFL;
|
||||
else if (stepIt != mySteps.end())
|
||||
if (++lstep <= stepIt->first.size())
|
||||
time.dt = stepIt->first[lstep-1];
|
||||
|
||||
|
@ -28,7 +28,6 @@ class SIMparameters
|
||||
public:
|
||||
//! \brief The constructor initializes the counters to zero.
|
||||
SIMparameters() : step(0), iter(time.it), lstep(0) { stepIt = mySteps.end(); }
|
||||
|
||||
//! \brief Empty destructor.
|
||||
virtual ~SIMparameters() {}
|
||||
|
||||
@ -51,11 +50,12 @@ public:
|
||||
|
||||
double starTime; //!< Start (pseudo)time of simulation
|
||||
double stopTime; //!< Stop (pseudo)time of simulation
|
||||
TimeSteps mySteps; //!< Time step definitions
|
||||
double maxCFL; //!< CFL restriction on time step size (0.0: no restriction)
|
||||
|
||||
private:
|
||||
size_t lstep; //!< Local step counter, i.e., within current \a *stepIt
|
||||
|
||||
TimeSteps mySteps; //!< Time step definitions
|
||||
TimeSteps::iterator stepIt; //!< Running iterator over the time steps
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user