/* Control input value are acceptable */
if(rho<_precision or cp<_precision)
{
- PetscPrintf(PETSC_COMM_WORLD,"rho = %.2f, cp = %.2f, precision = %.2f\n",rho,cp,_precision);
+ PetscPrintf(PETSC_COMM_WORLD,"rho = %.2f, cp = %.2f, precision = %.2e\n",rho,cp,_precision);
throw CdmathException("Error : parameters rho and cp should be strictly positive");
}
if(lambda < 0.)
throw CdmathException("Error : parameter dim cannot be negative");
}
- PetscPrintf(PETSC_COMM_WORLD,"Diffusion problem with density %.2f, specific heat %.2f, conductivity %.2f", rho,cp,lambda);
+ PetscPrintf(PETSC_COMM_WORLD,"\n Diffusion problem with density %.2e, specific heat %.2e, conductivity %.2e", rho,cp,lambda);
if(FECalculation)
- PetscPrintf(PETSC_COMM_WORLD," and finite elements method\n");
+ PetscPrintf(PETSC_COMM_WORLD," and finite elements method\n\n");
else
- PetscPrintf(PETSC_COMM_WORLD," and finite volumes method\n");
+ PetscPrintf(PETSC_COMM_WORLD," and finite volumes method\n\n");
_FECalculation=FECalculation;
_fileName = "SolverlabDiffusionProblem";
- _runLogFile=new ofstream;
-
/* Default diffusion tensor is diagonal */
_DiffusionTensor=Matrix(_Ndim);
for(int idim=0;idim<_Ndim;idim++)
*_runLogFile<< "Problem : dim = "<<_Ndim<< " but mesh dim= "<<_mesh.getMeshDimension()<<", mesh space dim= "<<_mesh.getSpaceDimension()<<endl;
*_runLogFile<<"DiffusionEquation::initialize: mesh has incorrect dimension"<<endl;
_runLogFile->close();
- throw CdmathException("DiffusionEquation::initialize: mesh has incorrect dimension");
+ throw CdmathException("!!!!!!!!DiffusionEquation::initialize: mesh has incorrect dimension");
}
if(!_initialDataSet)
- throw CdmathException("DiffusionEquation::initialize() set initial data first");
+ throw CdmathException("!!!!!!!!DiffusionEquation::initialize() set initial data first");
else
{
- PetscPrintf(PETSC_COMM_SELF,"Initialising the diffusion of a solid temperature using ");
+ PetscPrintf(PETSC_COMM_SELF,"\n Initialising the diffusion of a solid temperature using ");
*_runLogFile<<"Initialising the diffusion of a solid temperature using ";
if(!_FECalculation)
{
else
result=computeDiffusionMatrixFV(stop);
- PetscPrintf(PETSC_COMM_WORLD,"Maximum diffusivity is %.2f, CFL = %.2f, Delta x = %.2f\n",_maxvp,_cfl,_minl);
+ PetscPrintf(PETSC_COMM_WORLD,"Maximum diffusivity is %.2e, CFL = %.2f, Delta x = %.2e\n",_maxvp,_cfl,_minl);
MatAssemblyBegin(_A, MAT_FINAL_ASSEMBLY);
MatAssemblyEnd( _A, MAT_FINAL_ASSEMBLY);
}
else//dt<=0
{
- PetscPrintf(PETSC_COMM_WORLD,"DiffusionEquation::initTimeStep %.2f = \n",dt);
+ PetscPrintf(PETSC_COMM_WORLD,"DiffusionEquation::initTimeStep %.2e = \n",dt);
throw CdmathException("Error DiffusionEquation::initTimeStep : cannot set time step to zero");
}
//At this stage _b contains _b0 + power + heat exchange
}
void DiffusionEquation::save(){
- PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results\n\n");
- *_runLogFile<< "Saving numerical results"<< endl<<endl;
+ PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results at time step number %d \n\n", _nbTimeStep);
+ *_runLogFile<< "Saving numerical results at time step number "<< _nbTimeStep << endl<<endl;
string resultFile(_path+"/DiffusionEquation");//Results
*_runLogFile<<"Vapour saturation enthalpy "<< _hsatv<<" J/Kg"<<endl;
cout<<"Latent heat "<< _latentHeat<<endl;
*_runLogFile<<"Latent heat "<< _latentHeat<<endl;
+
+ _fileName = "SolverlabDriftModel";
+ PetscPrintf(PETSC_COMM_WORLD,"\n Drift model problem for two phase flow\n");
}
void DriftModel::initialize(){
- cout<<"Initialising the drift model"<<endl;
- *_runLogFile<<"Initialising the drift model"<<endl;
+ cout<<"\n Initialising the drift model"<<endl;
+ *_runLogFile<<"\n Initialising the drift model"<<endl;
_Uroe = new double[_nVar];
_gravite = vector<double>(_nVar,0);//Not to be confused with _GravityField3d (size _Ndim). _gravite (size _Nvar) is usefull for dealing with source term and implicitation of gravity vector
}
void DriftModel::save(){
+ PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results at time step number %d \n\n", _nbTimeStep);
+ *_runLogFile<< "Saving numerical results at time step number "<< _nbTimeStep << endl<<endl;
+
string prim(_path+"/DriftModelPrim_");
string cons(_path+"/DriftModelCons_");
string allFields(_path+"/");
}
_latentHeat=_hsatv-_hsatl;
_intPressCoeff=1.5;
+
+ _fileName = "SolverlabFiveEquationTwoFluid";
+ PetscPrintf(PETSC_COMM_WORLD,"\n Five equation two-fluid problem for two phase flow\n");
}
void FiveEqsTwoFluid::initialize()
{
- cout<<"Initialising the five equation two fluid model"<<endl;
- *_runLogFile<<"Initialising the five equation two fluid model"<<endl;
+ cout<<"\n Initialising the five equation two fluid model"<<endl;
+ *_runLogFile<<"\n Initialising the five equation two fluid model"<<endl;
if(static_cast<StiffenedGas*>(_fluides[0])==NULL || static_cast<StiffenedGas*>(_fluides[1])==NULL)
- throw CdmathException("FiveEqsTwoFluid::initialize: both phase must have stiffened gas EOS");
+ throw CdmathException("!!!!!!!!FiveEqsTwoFluid::initialize: both phase must have stiffened gas EOS");
_Uroe = new double[_nVar+1];
}
void FiveEqsTwoFluid::save(){
+ PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results at time step number %d \n\n", _nbTimeStep);
+ *_runLogFile<< "Saving numerical results at time step number "<< _nbTimeStep << endl<<endl;
+
string prim(_path+"/FiveEqsTwoFluidPrim_");
string cons(_path+"/FiveEqsTwoFluidCons_");
prim+=_fileName;
_fluides[1] = new StiffenedGas(594,1.55e7,_Temperature,_internalEnergy2, 621,3100); //stiffened gas law for water at pressure 155 bar and temperature 345°C:
}
_intPressCoeff=1.5;
+
+ _fileName = "SolverlabIsothermalTwoFluid";
+ PetscPrintf(PETSC_COMM_WORLD,"\n Isothermal two-fluid problem for two phase flow\n");
}
void IsothermalTwoFluid::initialize(){
- cout<<"Initialising the isothermal two-fluid model"<<endl;
- *_runLogFile<<"Initialising the isothermal two-fluid model"<<endl;
+ cout<<"\n Initialising the isothermal two-fluid model\n"<<endl;
+ *_runLogFile<<"\n Initialising the isothermal two-fluid model\n"<<endl;
_Uroe = new double[_nVar+1];
}
void IsothermalTwoFluid::save(){
+ PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results at time step number %d \n\n", _nbTimeStep);
+ *_runLogFile<< "Saving numerical results at time step number "<< _nbTimeStep << endl<<endl;
+
string prim(_path+"/IsothermalTwoFluidPrim_");
string cons(_path+"/IsothermalTwoFluidCons_");
prim+=_fileName;
{
if(!_initialDataSet)
{
- *_runLogFile<<"ProblemFluid::initialize() set initial data first"<<endl;
+ *_runLogFile<<"!!!!!!!!ProblemFluid::initialize() set initial data first"<<endl;
_runLogFile->close();
- throw CdmathException("ProblemFluid::initialize() set initial data first");
+ throw CdmathException("!!!!!!!!ProblemFluid::initialize() set initial data first");
}
else if (_VV.getTypeOfField() != CELLS)
{
- *_runLogFile<<"Initial data should be a field on CELLS, not NODES, neither FACES"<<endl;
+ *_runLogFile<<"!!!!!!!!Initial data should be a field on CELLS, not NODES, neither FACES"<<endl;
_runLogFile->close();
- throw CdmathException("ProblemFluid::initialize() Initial data should be a field on CELLS, not NODES, neither FACES");
+ throw CdmathException("!!!!!!!!ProblemFluid::initialize() Initial data should be a field on CELLS, not NODES, neither FACES");
}
cout << "Number of Phases = " << _nbPhases << " mesh dimension = "<<_Ndim<<" number of variables = "<<_nVar<<endl;
*_runLogFile << "Number of Phases = " << _nbPhases << " spaceDim= "<<_Ndim<<" number of variables= "<<_nVar<<endl;
_FECalculation=false;//Only finite volumes available
_rodTemperatureFieldSet=false;
_rodTemperature=0;
+
+ _fileName = "SolverlabTransportProblem";
+ PetscPrintf(PETSC_COMM_WORLD,"\n Transport problem of fluid enthalpy with constant velocity\n");
}
void TransportEquation::initialize()
if(_mpi_rank==0)
{
if(!_initialDataSet)
- throw CdmathException("TransportEquation::initialize() set initial data first");
+ throw CdmathException("!!!!!!!!TransportEquation::initialize() set initial data first");
else if (_VV.getTypeOfField() != CELLS)
- throw CdmathException("TransportEquation::initialize() Initial data should be a field on CELLS, not NODES, neither FACES");
+ throw CdmathException("!!!!!!!!TransportEquation::initialize() Initial data should be a field on CELLS, not NODES, neither FACES");
else
- PetscPrintf(PETSC_COMM_SELF,"Initialising the transport of a fluid enthalpy\n");
+ PetscPrintf(PETSC_COMM_SELF,"\n Initialising the transport of a fluid enthalpy\n");
/**************** Field creation *********************/
_transportMatrixSet=true;
MPI_Bcast(&_maxvp, 1, MPI_DOUBLE, 0, PETSC_COMM_WORLD);
- PetscPrintf(PETSC_COMM_WORLD, "Maximum speed is %.2f, CFL = %.2f, Delta x = %.2f\n",_maxvp,_cfl,_minl);
+ PetscPrintf(PETSC_COMM_WORLD, "Maximum conductivity is %.2e, CFL = %.2f, Delta x = %.2e\n",_maxvp,_cfl,_minl);
MatAssemblyBegin(_A, MAT_FINAL_ASSEMBLY);
MatAssemblyEnd( _A, MAT_FINAL_ASSEMBLY);
}
else//dt<=0
{
- PetscPrintf(PETSC_COMM_WORLD,"TransportEquation::initTimeStep %.2f = \n",dt);
+ PetscPrintf(PETSC_COMM_WORLD,"TransportEquation::initTimeStep %.2e = \n",dt);
throw CdmathException("Error TransportEquation::initTimeStep : cannot set time step to zero");
}
//At this stage _b contains _b0 + power + heat exchange
}
void TransportEquation::save(){
- PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results\n\n");
+ PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results at time step number %d \n\n", _nbTimeStep);
+ *_runLogFile<< "Saving numerical results at time step number "<< _nbTimeStep << endl<<endl;
string resultFile(_path+"/TransportEquation_");///Results
resultFile+=_fileName;