Commit 9b1d9d87 authored by Alain O' Miniussi's avatar Alain O' Miniussi
Browse files

Merge branch 'master' into STAR33

Conflicts:
	test/integration/CMakeLists.txt

Former-commit-id: 395f5210dc4f5ba36e48d0d965ee2c8cb857f0a7
parents 563494a3 804fcfeb
......@@ -23,9 +23,7 @@ namespace ADC {
void ReadVariables (char *filename, boost::property_tree::ptree& cfg);
void PrintUsage (char *execname);
real TellNbOrbits (real time);
real TellNbOutputs (real time);
void TellEverything (DiskDesc const&);
void TellEverything(DiskDesc const&,SimTimeConfig const&);
void GiveTimeInfo (int number);
void InitSpecificTime (bool profiling, TimeProcess *process_name, char const *title);
void GiveSpecificTime (bool profiling, TimeProcess process_name);
......
......@@ -56,9 +56,6 @@ namespace ADC {
PlanetarySystem const* sys,
int planet_index,
int output_number);
real GetTimeFromDiskInfoFile (real TimeStep);
void UpdateOrbitFiles (PlanetarySystem const* sys,
const real time);
void UpdateSingleOrbitFile (PlanetarySystem const* sys,
......
......@@ -3,6 +3,8 @@
#include "polarGridFwd.hpp"
#include "diskDesc.hpp"
#include "simTimeConfig.hpp"
#include "ADC/PlanetarySystem.h"
#include "ADC/Force.h"
#include "ADC/dustMethods.h"
......@@ -51,6 +53,7 @@ namespace ADC {
real* vrad_init,
real* vtheta_init,
real physicalTime,
SimTimeConfig const&,
bool oldBoundaries,
bool isDisk);
......
......@@ -28,9 +28,7 @@ namespace D3 {
void ReadVariables (char *filename, boost::property_tree::ptree& cfg, boost::mpi::communicator const&);
void PrintUsage (char *execname);
real TellNbOrbits (real time);
real TellNbOutputs (real time);
void TellEverything(DiskDesc const&);
void TellEverything(DiskDesc const&,SimTimeConfig const&);
void GiveTimeInfo (int number);
void InitSpecificTime (bool profiling, TimeProcess *process_name, char const *title);
void GiveSpecificTime (bool profiling, TimeProcess process_name);
......
......@@ -4,11 +4,12 @@
#include "precision.hpp"
#include "polarGrid.hpp"
#include "planetarySystem.hpp"
#include "simTimeConfig.hpp"
namespace D3 {
using namespace fargOCA;
void InitEuler(PolarGrid *Rho,
PolarGrid *Vr,
PolarGrid *Vt,
......@@ -27,6 +28,7 @@ namespace D3 {
PolarGrid *Label,
PolarGrid *Viscosity,
PlanetarySystem *sys,
SimTimeConfig const& timeCfg,
real *radialFlow,
std::vector<real>* torque,
std::vector<real>* torqueh,
......
......@@ -12,6 +12,7 @@
#include "precision.hpp"
#include "diskDesc.hpp"
#include "simTimeConfig.hpp"
namespace fargOCA {
......@@ -140,6 +141,8 @@ namespace fargOCA {
ExtractReferential(boost::property_tree::ptree const& cfg);
GridSpacing
ExtractGridSpacing(boost::property_tree::ptree const& cfg);
SimTimeConfig
ExtractSimTimeConfig(boost::property_tree::ptree const& cfg);
}
#endif
......
#ifndef FARGOCA_SIM_TIME_CONFIG_H
#define FARGOCA_SIM_TIME_CONFIG_H
#include "precision.hpp"
namespace fargOCA {
/// \brief Provide simulation related time informatin.
/// Is this a restart, what the cureent time etc..
class SimTimeConfig {
public:
SimTimeConfig(real dt);
real dt() const { return myDeltaTime; }
private:
real myDeltaTime;
bool myRestart;
};
}
#endif
......@@ -17,6 +17,7 @@
#include "debug.hpp"
#include "diskDesc.hpp"
#include "simTimeConfig.hpp"
#include "D3/axilib.h"
#include "D3/energy.h"
#include "D3/lowTasks.h"
......@@ -59,7 +60,7 @@ main(int argc,
char *argv[])
{
int TimeStep = 0;
int InnerOutputCounter=0, StillWriteOneOutput = 0;
int StillWriteOneOutput = 0;
PolarGrid *gas_density, *gas_v_rad, *gas_v_theta, *gas_v_phi, *gas_label;
PolarGrid *gas_energy, *gas_temper, *gas_radenergy;
bool disable = false;
......@@ -191,6 +192,7 @@ main(int argc,
ExtractReferential(cfg.get_child("Disk.Referential")),
ExtractGridSpacing(cfg.get_child("Disk.Grid")));
DiskDesc::InstallInstance(disk);
SimTimeConfig timeCfg = ExtractSimTimeConfig(cfg);
if (master) {
disk.grid().save();
......@@ -214,7 +216,7 @@ main(int argc,
if (master) {
sys->listPlanets(std::cout);
if (verbose) {
TellEverything(disk);
TellEverything(disk, timeCfg);
}
}
if (disable) {
......@@ -311,14 +313,10 @@ main(int argc,
torqueh = new std::vector<real>(disk.grid().managedRadiusMax()-disk.grid().managedRadiusMin());
}
for (int i = begin_i; i < NTOT; i++) {
InnerOutputCounter++;
if (InnerOutputCounter == 1) {
InnerOutputCounter = 0;
WriteBigPlanetSystemFile (sys, TimeStep);
UpdateLog (sys, gas_density,TimeStep,PhysicalTime,
torque, torqueh);
}
WriteBigPlanetSystemFile (sys, TimeStep);
UpdateLog (sys, gas_density,TimeStep,PhysicalTime,
torque, torqueh);
TimeStep = i / NINTERM;
if (NINTERM * TimeStep == i) /* Outputs are done here */ { // No kidding !!!
if (cfg.get<bool>("Disk")) {
......@@ -351,7 +349,7 @@ main(int argc,
{
TimeProcess hydroTime;
InitSpecificTime (Profiling, &hydroTime, "Eulerian Hydro algorithms");
AlgoGas (gas_density, gas_v_rad, gas_v_theta, gas_v_phi,gas_energy,gas_temper,gas_radenergy,gas_label,&Viscosity,sys,flow,torque, torqueh, cfg.get<bool>("Disk"));
AlgoGas (gas_density, gas_v_rad, gas_v_theta, gas_v_phi,gas_energy,gas_temper,gas_radenergy,gas_label,&Viscosity,sys,timeCfg,flow,torque, torqueh, cfg.get<bool>("Disk"));
GiveSpecificTime (Profiling, hydroTime);
}
SolveOrbits (sys);
......
......@@ -7,7 +7,9 @@
#include <cstring>
#include "io.hpp"
#include "diskDesc.hpp"
#include "parameters.hpp"
#include "simTimeConfig.hpp"
#include "ADC/global_ex.h"
#include "ADC/PolarGrid.h"
......@@ -136,6 +138,7 @@ main(int argc,
ExtractReferential(cfg.get_child("Disk.Referential")),
ExtractGridSpacing(cfg.get_child("Disk.Grid")));
DiskDesc::InstallInstance(disk);
SimTimeConfig timeCfg = ExtractSimTimeConfig(cfg);
if (master) {
disk.grid().save();
if (Restart) {
......@@ -149,7 +152,7 @@ main(int argc,
}
if (verbose && master) {
TellEverything(disk);
TellEverything(disk, timeCfg);
}
if (disable) PrsExit (0);
......@@ -227,7 +230,7 @@ main(int argc,
if (Restart) {
begin_i = NbRestart * NINTERM;
RestartPlanetarySystem (NbRestart, sys);
physicalTime = NbRestart*DT;
physicalTime = NbRestart*timeCfg.dt();
} else {
physicalTime = 0;
if (master) {
......@@ -242,11 +245,7 @@ main(int argc,
MultiplyPolarGridbyConstant (gasDensity, ScalingFactor);
for (int i = begin_i; i <= NTOT; i++) {
InnerOutputCounter++;
if (InnerOutputCounter == 1) {
InnerOutputCounter = 0;
UpdateForceLog (&force, sys, gasDensity, TimeStep, physicalTime);
}
UpdateForceLog (&force, sys, gasDensity, TimeStep, physicalTime);
if (NINTERM * (TimeStep = (i / NINTERM)) == i) {
/* Outputs are done here */
TimeToWrite = true;
......@@ -280,9 +279,10 @@ main(int argc,
tracers, EpsProfile,
Density_init, Vrad_init, Vtheta_init,
physicalTime,
timeCfg,
cfg.get<bool>("Euler.OldBoundaries", true),
cfg.get<bool>("Disk"));
physicalTime += DT;
physicalTime += timeCfg.dt();
GiveSpecificTime (Profiling, t_Hydro);
UpdateOrbitFiles (sys, physicalTime);
......
#include <numeric>
#include <boost/mpi.hpp>
#include "ADC/global_ex.h"
#include "ADC/PolarGrid.h"
#include "ADC/boundaryConditions.h"
......
......@@ -232,6 +232,7 @@ namespace ADC {
int nr = thermoFields->diskDesc.nRad();
int ns = thermoFields->diskDesc.nSec();
if (Restart) {
world.barrier();
ReadPrevDim();
}
......
......@@ -235,24 +235,16 @@ namespace ADC {
return time/2.0/PI*sqrt(G*1.0/1.0/1.0/1.0);
}
real TellNbOutputs (real time)
{
return (time/DT/NINTERM);
}
void
TellEverything(DiskDesc const& disk)
TellEverything(DiskDesc const& disk, SimTimeConfig const& timeCfg)
{
real temp;
printf ("\nDisc properties:\n");
printf ("----------------\n");
printf ("Sector : %g [rad], or in deg : %g \n", disk.shape().sector, disk.shape().sector/PI*180);
printf ("Aspect Ratio : %g\n", disk.shape().aspectRatio);
printf ("VKep at inner edge : %.3g\n", sqrt(G*1.0*(1.-0.0)/disk.shape().radiusMin));
printf ("VKep at outer edge : %.3g\n", sqrt(G*1.0/disk.shape().radiusMax));
temp=2.0*PI*SIGMA0/(2.0-SIGMASLOPE)*(pow(disk.shape().radiusMax,2.0-SIGMASLOPE) - pow(disk.shape().radiusMin,2.0-SIGMASLOPE)); /* correct this and what follows... */
real temp=2.0*PI*SIGMA0/(2.0-SIGMASLOPE)*(pow(disk.shape().radiusMax,2.0-SIGMASLOPE) - pow(disk.shape().radiusMin,2.0-SIGMASLOPE)); /* correct this and what follows... */
printf ("Initial Disk Mass : %g\n", temp);
temp=2.0*PI*SIGMA0/(2.0-SIGMASLOPE)*(1.0 - pow(disk.shape().radiusMin,2.0-SIGMASLOPE));
printf ("Initial Mass inner to r=1.0 : %g \n", temp);
......@@ -260,15 +252,15 @@ namespace ADC {
printf ("Initial Mass outer to r=1.0 : %g \n", temp);
printf ("Travelling time for acoustic density waves :\n");
temp = 2.0/3.0/disk.shape().aspectRatio*(pow(disk.shape().radiusMax,1.5)-pow(disk.shape().radiusMin,1.5));
printf (" * From Rmin to Rmax : %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), TellNbOutputs(temp));
printf (" * From Rmin to Rmax : %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), temp/timeCfg.dt()/NINTERM);
temp = 2.0/3.0/disk.shape().aspectRatio*(pow(disk.shape().radiusMax,1.5)-pow(1.0,1.5));
printf (" * From r=1.0 to Rmax: %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), TellNbOutputs(temp));
printf (" * From r=1.0 to Rmax: %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), temp/timeCfg.dt()/NINTERM);
temp = 2.0/3.0/disk.shape().aspectRatio*(pow(1.0,1.5)-pow(disk.shape().radiusMin,1.5));
printf (" * From r=1.0 to Rmin: %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), TellNbOutputs(temp));
printf (" * From r=1.0 to Rmin: %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), temp/timeCfg.dt()/NINTERM);
temp = 2.0*PI*sqrt(disk.shape().radiusMin*disk.shape().radiusMin*disk.shape().radiusMin/G/1.0);
printf ("Orbital time at Rmin : %.3g ~ %.2f outputs\n", temp, TellNbOutputs(temp));
printf ("Orbital time at Rmin : %.3g ~ %.2f outputs\n", temp, temp/timeCfg.dt()/NINTERM);
temp = 2.0*PI*sqrt(disk.shape().radiusMax*disk.shape().radiusMax*disk.shape().radiusMax/G/1.0);
printf ("Orbital time at Rmax : %.3g ~ %.2f outputs\n", temp, TellNbOutputs(temp));
printf ("Orbital time at Rmax : %.3g ~ %.2f outputs\n", temp, temp/timeCfg.dt()/NINTERM);
printf ("Sound speed :\n");
printf (" * At unit radius : %.3g\n", disk.shape().aspectRatio*sqrt(G*1.0));
printf (" * At outer edge : %.3g\n", disk.shape().aspectRatio*sqrt(G*1.0/disk.shape().radiusMax));
......@@ -279,9 +271,9 @@ namespace ADC {
printf ("Number of sectors : %d\n", disk.grid().nbSector());
printf ("\nOutputs properties:\n");
printf ("-------------------\n");
printf ("Time increment between outputs : %.3f = %.3f orbits\n", NINTERM*DT, TellNbOrbits(NINTERM*DT));
printf ("Time increment between outputs : %.3f = %.3f orbits\n", NINTERM*timeCfg.dt(), TellNbOrbits(NINTERM*timeCfg.dt()));
printf ("There will be in total %d outputs\n", NTOT/NINTERM);
printf ("(which correspond to an elapsed time = %.3f or to %.2f orbits)\n", NTOT*DT, TellNbOrbits(NTOT*DT));
printf ("(which correspond to an elapsed time = %.3f or to %.2f orbits)\n", NTOT*timeCfg.dt(), TellNbOrbits(NTOT*timeCfg.dt()));
}
......
......@@ -300,33 +300,4 @@ namespace ADC {
fclose (output);
}
}
real GetTimeFromDiskInfoFile(const real TimeStep)
{
char *pt;
FILE* input = OFileOpen("disk_info.dat", "r");
//find the line corresponding to specified TimeStep
int step=-1;
char line[20+10*(16+10)+1];
do {
pt = fgets (line, 20+10*(16+10)+1, input);
sscanf (line, "%d", &step);
} while ((step != TimeStep) && (pt != NULL));
if (pt == NULL) {
MasterErr ("Can't read entry %d in 'disk_info.dat' file. Aborting.\n", TimeStep);
PrsExit (1);
}
fclose (input);
pt = line;
pt += strspn(pt, "0123456789");//read an int
pt += strspn(pt, "\t ");//read spaces
//next in line is the number we want
double phystime=0.0;
sscanf (pt, "%lf", &phystime);
return (real)phystime;
}
}
......@@ -4,6 +4,7 @@
#include <stdlib.h>
#include "io.hpp"
#include "simTimeConfig.hpp"
#include "sourceEuler.hpp"
#include "ADC/sourceEuler.h"
......@@ -55,7 +56,6 @@ namespace ADC {
extern PolarGrid *Aat,*Cct,*Aar,*Ccr,*Bb,*Rhs;
real PhysicalTimeInitial;
int FirstGasStepFLAG=1;
extern bool FastTransport;
extern bool DustyMode, FrozenDust, DustTesting, Ssd1on, Ssd2on;
......@@ -140,6 +140,7 @@ namespace ADC {
real* vrad_init,
real* vtheta_init,
real time,
SimTimeConfig const& timeCfg,
bool useOldBoundaries,
bool isDisk)
{
......@@ -149,7 +150,6 @@ namespace ADC {
Pair DiskOnPrimaryAcceleration = { 0, 0 };
real timeInit = time;
real dtemp=0.0;
FirstGasStepFLAG=1;
bool adiabatic = bool(thermoFields->energy);
int gasTimeStepCFL = 1;
if (isDisk) {
......@@ -162,12 +162,12 @@ namespace ADC {
}
if (SloppyCFL) {
gasTimeStepCFL = mpi::all_reduce(comm,
ConditionCFL(thermoFields, Vrad, Vtheta, DT-dtemp),
ConditionCFL(thermoFields, Vrad, Vtheta, timeCfg.dt()-dtemp),
mpi::maximum<int>());
}
}
real dt = DT / real(gasTimeStepCFL);
while (dtemp < 0.999999999*DT) {
real dt = timeCfg.dt() / real(gasTimeStepCFL);
while (dtemp < 0.999999999*timeCfg.dt()) {
UpdatePlanetarySystemMasses (sys, time);
if (isDisk) {
for (PolarGrid* g : {Density, Vrad, Vtheta, thermoFields->energy, Label, DustFraction}) {
......@@ -175,9 +175,9 @@ namespace ADC {
}
if (!SloppyCFL) {
gasTimeStepCFL = mpi::all_reduce(comm,
ConditionCFL(thermoFields, Vrad, Vtheta, DT-dtemp),
ConditionCFL(thermoFields, Vrad, Vtheta, timeCfg.dt()-dtemp),
mpi::maximum<int>());
dt = (DT-dtemp)/real(gasTimeStepCFL);
dt = (timeCfg.dt()-dtemp)/real(gasTimeStepCFL);
}
AccreteOntoPlanets (sys, Density, Vrad, Vtheta, Label, dt, time);
}
......
......@@ -98,7 +98,6 @@ namespace ADC {
myParams["WRITEVORTENSITY"] = Param("WRITEVORTENSITY", "Disk.WriteVortensity", STRING, "false");
// MISC ****************************************************************
var("DT", &DT, REAL, true, "1.");
var("NINTERM", &NINTERM, INT, true, "10.");
var("NTOT", &NTOT, INT, true, "1501.");
var("TRANSPORT", TRANSPORT, STRING, false, "FAST");
......
......@@ -8,6 +8,7 @@ add_library(fargOCA
parameters.cpp
planetarySystem.cpp
polarGrid.cpp
simTimeConfig.cpp
sourceEuler.cpp
transport.cpp
)
......
......@@ -77,7 +77,6 @@ namespace D3 {
void
Parameters::postProcess() {
super::postProcess();
translate<bool>("ROTATESYS");
translate<bool>("WRITERADIALFLOW");
translate<bool>("WRITETORQUE");
......@@ -353,14 +352,8 @@ namespace D3 {
return time/2.0/PI*sqrt(G*1.0/1.0/1.0/1.0);
}
real TellNbOutputs (real time)
void TellEverything (DiskDesc const& disk, SimTimeConfig const& timeCfg)
{
return (time/DT/NINTERM);
}
void TellEverything (DiskDesc const& disk)
{
real temp;
printf ("\nDisc properties:\n");
printf ("----------------\n");
printf ("Inner Radius : %g\n", disk.shape().radiusMin);
......@@ -368,7 +361,7 @@ namespace D3 {
printf ("Aspect Ratio : %g\n", disk.shape().aspectRatio);
printf ("VKep at inner edge : %.3g\n", sqrt(G*1.0*(1.-0.0)/disk.shape().radiusMin));
printf ("VKep at outer edge : %.3g\n", sqrt(G*1.0/disk.shape().radiusMax));
temp=SIGMA0*PI*(disk.shape().radiusMax*disk.shape().radiusMax-disk.shape().radiusMin*disk.shape().radiusMin); /* correct this and what follows... */
real temp=SIGMA0*PI*(disk.shape().radiusMax*disk.shape().radiusMax-disk.shape().radiusMin*disk.shape().radiusMin); /* correct this and what follows... */
printf("Light velocity: %g\n",C0);
printf ("Disk Mass : %g\n", temp);
printf ("Sector : %g [rad], or in deg : %g \n", disk.shape().sector, disk.shape().sector/PI*180);
......@@ -378,15 +371,15 @@ namespace D3 {
printf ("Mass outer to r=1.0 : %g \n", temp);
printf ("Travelling time for acoustic density waves :\n");
temp = 2.0/3.0/disk.shape().aspectRatio*(pow(disk.shape().radiusMax,1.5)-pow(disk.shape().radiusMin,1.5));
printf (" * From Rmin to Rmax : %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), TellNbOutputs(temp));
printf (" * From Rmin to Rmax : %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), temp/timeCfg.dt()/NINTERM);
temp = 2.0/3.0/disk.shape().aspectRatio*(pow(disk.shape().radiusMax,1.5)-pow(1.0,1.5));
printf (" * From r=1.0 to Rmax: %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), TellNbOutputs(temp));
printf (" * From r=1.0 to Rmax: %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), temp/timeCfg.dt()/NINTERM);
temp = 2.0/3.0/disk.shape().aspectRatio*(pow(1.0,1.5)-pow(disk.shape().radiusMin,1.5));
printf (" * From r=1.0 to Rmin: %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), TellNbOutputs(temp));
printf (" * From r=1.0 to Rmin: %.2g = %.2f orbits ~ %.1f outputs\n", temp, TellNbOrbits(temp), temp/timeCfg.dt()/NINTERM);
temp = 2.0*PI*sqrt(disk.shape().radiusMin*disk.shape().radiusMin*disk.shape().radiusMin/G/1.0);
printf ("Orbital time at Rmin : %.3g ~ %.2f outputs\n", temp, TellNbOutputs(temp));
printf ("Orbital time at Rmin : %.3g ~ %.2f outputs\n", temp, temp/timeCfg.dt()/NINTERM);
temp = 2.0*PI*sqrt(disk.shape().radiusMax*disk.shape().radiusMax*disk.shape().radiusMax/G/1.0);
printf ("Orbital time at Rmax : %.3g ~ %.2f outputs\n", temp, TellNbOutputs(temp));
printf ("Orbital time at Rmax : %.3g ~ %.2f outputs\n", temp, temp/timeCfg.dt()/NINTERM);
printf ("Sound speed :\n");
printf (" * At unit radius : %.3g\n", disk.shape().aspectRatio*sqrt(G*1.0));
printf (" * At outer edge : %.3g\n", disk.shape().aspectRatio*sqrt(G*1.0/disk.shape().radiusMax));
......@@ -398,10 +391,10 @@ namespace D3 {
printf ("Number of cells along z : %d\n", disk.grid().nbLayer());
printf ("\nOutputs properties:\n");
printf ("-------------------\n");
printf ("Time increment between outputs : %.3f = %.3f orbits\n", NINTERM*DT, TellNbOrbits(NINTERM*DT));
printf ("Time increment between outputs : %.3f = %.3f orbits\n", NINTERM*timeCfg.dt(), TellNbOrbits(NINTERM*timeCfg.dt()));
printf ("At each output #i, the following files are written:\n");
printf ("There will be in total %d outputs\n", NTOT/NINTERM);
printf ("(which correspond to an elapsed time = %.3f or to %.2f orbits)\n", NTOT*DT, TellNbOrbits(NTOT*DT));
printf ("(which correspond to an elapsed time = %.3f or to %.2f orbits)\n", NTOT*timeCfg.dt(), TellNbOrbits(NTOT*timeCfg.dt()));
temp =3*disk.grid().nbRadius()*disk.grid().nbSector()*disk.grid().nbLayer()*sizeof(real);
if (AdvecteLabel)
temp *= 4.0/3.0;
......
......@@ -441,7 +441,8 @@ namespace D3 {
PolarGrid *Label,
PolarGrid *Viscosity,
PlanetarySystem *sys,
real *flow,
SimTimeConfig const& timeCfg,
real *flow,
std::vector<real>* torque,
std::vector<real>* torqueh,
bool isDisk)
......@@ -463,20 +464,20 @@ namespace D3 {
if (g) { g->setGhosts(); }
}
if (SloppyCFL)
gastimestepcfl = ConditionCFL (Vrad, Vtheta,Vphi, Viscosity, DT-dtemp);
gastimestepcfl = ConditionCFL (Vrad, Vtheta,Vphi, Viscosity, timeCfg.dt()-dtemp);
}
GasTimeStepsCFL = mpi::all_reduce(grid.comm(), gastimestepcfl, mpi::maximum<int>());
dt = DT / (real)GasTimeStepsCFL;
while (dtemp < 0.999999999*DT) {
dt = timeCfg.dt() / (real)GasTimeStepsCFL;
while (dtemp < 0.999999999*timeCfg.dt()) {
if (isDisk) {
for (PolarGrid *g : { Vrad,Vtheta,Vphi,Rho,Energy,Temperature,EnergyRad,Label}) {
if (g) { g->setGhosts(); }
}
if (!SloppyCFL) {
gastimestepcfl = 1;
gastimestepcfl = ConditionCFL (Vrad, Vtheta,Vphi, Viscosity, DT-dtemp);
gastimestepcfl = ConditionCFL (Vrad, Vtheta,Vphi, Viscosity, timeCfg.dt()-dtemp);
GasTimeStepsCFL = mpi::all_reduce(grid.comm(), gastimestepcfl, mpi::maximum<int>());
dt = (DT-dtemp)/(real)GasTimeStepsCFL;
dt = (timeCfg.dt()-dtemp)/(real)GasTimeStepsCFL;
}
AccreteOntoPlanets(Rho, Vrad, Vtheta,Vphi, dt, sys);
}
......
......@@ -16,13 +16,11 @@ namespace D3 {
Parameters::init()
{
super::init();
myParams["ROTATESYS"] = Param("ROTATESYS", "PlanetarySystem.Rotate", STRING, "NO");
myParams["WRITERADIALFLOW"] = Param("WRITERADIALFLOW", "disk.WriteRadialFlow", STRING, "false");
myParams["WRITETORQUE"] = Param("WRITETORQUE", "Disk.WriteTorque", STRING, "false");
myParams["SIGMADISK"] = Param("SIGMADISK", "Dead.SigmaDisk", REAL, "1");
myParams["PHIDISK"] = Param("PHIDISK", "Disk.Grid.Opening", REAL, "0.01");
var("DT", &DT, REAL, true, "1");
var("DEADVISCOSITY", DEADVISCOSITY, STRING, false, "NO");
var("VISCOSTELLAR", VISCOSTELLAR, STRING, false, "NO");
var("SIGMA0", &SIGMA0, REAL, true, "173");
......
......@@ -192,10 +192,14 @@ namespace fargOCA {
translate<bool>("INDIRECTTERM");
translate("OMEGAFRAME");
translate("NEWOMEGAFRAME");
translate<bool>("ROTATESYS");
translate("OUTPUTDIR");
if (!HasOutputDir()) {
SetOutputDir(myCfg.get<std::string>("Output.Dir"));
}
translate("DT");
if( myCfg.get<bool>("Disk.AdiabaticEoS")) {
if ( std::fabs(myCfg.get<real>("Disk.AdiabaticIndex") - 1) < 10*std::numeric_limits<real>::epsilon()) {
std::cerr << "You cannot have Adiabatic = YES and AdiabaticIndex = 1\n";
......@@ -233,11 +237,15 @@ namespace fargOCA {
myParams["ADIABATICINDEX"] = Param("ADIABATICINDEX", "Disk.AdiabaticIndex", REAL, "1.4");
myParams["FRAME"] = Param("FRAME", "Disk.Referential.Type", STRING, "Rotating");
myParams["ROTATESYS"] = Param("ROTATESYS", "PlanetarySystem.Rotate", STRING, "NO");
myParams["INDIRECTTERM"] = Param("INDIRECTTERM", "Disk.Referential.indirectForces", STRING, "YES");
myParams["OMEGAFRAME"] = Param("OMEGAFRAME", "Disk.Referential.omega", REAL, "0.0");
myParams["NEWOMEGAFRAME"] = Param("NEWOMEGAFRAME", "Disk.Referential.newOmega", REAL, "0.0");
myParams["OUTPUTDIR"] = Param("OUTPUTDIR", "Output.Dir", STRING, "out");
myParams["DT"] = Param("DT", "Output.TimeStep", REAL, "1");
}
void
......@@ -375,4 +383,9 @@ namespace fargOCA {
cfg.get<real>("Rmax"),
cfg.get<int>("Nrad")));
}
SimTimeConfig
ExtractSimTimeConfig(boost::property_tree::ptree const& cfg) {
return SimTimeConfig(cfg.get<real>("Output.TimeStep"));
}
}
Markdown is supported
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