1 #include "TransportEquation.hxx"
8 TransportEquation::TransportEquation(FluidMaterial fluid, pressureEstimate pEstimate,vector<double> vitesseTransport, MPI_Comm comm):ProblemCoreFlows(comm)
10 if(pEstimate==around1bar300K){
14 case Air://Nitrogen pressure 1 bar and temperature 27°C
15 _href=3.11e5; //nitrogen enthalpy at 1 bar and 300K
16 _cpref=1041;//nitrogen specific heat at constant pressure 1 bar and 300K
17 //saturation data for nitrogen at 1 bar and 77K
18 _hsatv=0.77e5;//nitrogen vapour enthalpy at saturation at 1 bar
19 _hsatl=-1.22e5;//nitrogen liquid enthalpy at saturation at 1 bar
20 _rhosatv=4.556;//nitrogen vapour density at saturation at 1 bar
21 _rhosatl=806.6;//nitrogen liquid density at saturation at 1 bar
22 cout<<"Air at around 1 bar and 300 Kelvin"<<endl;
24 case Water://Water at pressure 1 bar and temperature 27°C
25 _href=1.127e5; //water enthalpy at 1 bar and 300K
26 _cpref=4181;//water specific heat at 1 bar and 300K
27 //saturation data for water at 1 bar and 373K
28 _hsatv=2.675e6;//Gas enthalpy at saturation at 1 bar
29 _hsatl=4.175e5;//water enthalpy at saturation at 1 bar
30 _rhosatv=0.6;//Gas density at saturation at 1 bar
31 _rhosatl=958;//water density at saturation at 1 bar
32 cout<<"Water at around 1 bar and 300 Kelvin"<<endl;
35 cout<<"Error TransportEquation::TransportEquation : Only Gas and Liquid phases accepted"<<endl;
36 throw CdmathException("TransportEquation::TransportEquation : Wrong material phase requested");
39 else{//around155bars600K
43 case Air://Nitrogen pressure 155 bars and temperature 327°C
44 _href=2.675e6; //Gas enthalpy at 155 bars and 618K
45 _cpref=14001;//Gas specific heat at 155 bar and 618K
46 cout<<"Air at around 155 bar and 600 Kelvin"<<endl;
48 case Water://Water at pressure 155 bars and temperature 327°C
49 _href=4.175e5;//water enthalpy at 155 bars and 618K
50 _cpref=8950;//water specific heat at 155 bar and 618K
51 cout<<"Water at around 155 bar and 600 Kelvin"<<endl;
54 cout<<"Error TransportEquation::TransportEquation : Only Gas and Liquid phases accepted"<<endl;
55 throw CdmathException("TransportEquation::TransportEquation : Wrong material phase requested");
57 //saturation data for water at 155 bars and 618K
58 _hsatv=2.6e6;//Gas enthalpy at saturation at 155 bars
59 _hsatl=1.63e6;//water enthalpy at saturation at 155 bars
60 _rhosatv=101.9;//Gas density at saturation at 155 bars
61 _rhosatl=594.4;//water density at saturation at 155 bars
63 _Ndim=vitesseTransport.size();
64 _vitesseTransport=Vector(_Ndim);
65 for(int i=0;i<_Ndim;i++)
66 _vitesseTransport[i]=vitesseTransport[i];
70 _transportMatrixSet=false;
71 _FECalculation=false;//Only finite volumes available
72 _rodTemperatureFieldSet=false;
75 _fileName = "SolverlabTransportProblem";
76 PetscPrintf(PETSC_COMM_WORLD,"\n Transport problem of fluid enthalpy with constant velocity\n");
79 void TransportEquation::initialize()
84 throw CdmathException("!!!!!!!!TransportEquation::initialize() set initial data first");
85 else if (_VV.getTypeOfField() != CELLS)
86 throw CdmathException("!!!!!!!!TransportEquation::initialize() Initial data should be a field on CELLS, not NODES, neither FACES");
88 PetscPrintf(PETSC_COMM_SELF,"\n Initialising the transport of a fluid enthalpy\n");
90 /**************** Field creation *********************/
92 //post processing fields used only for saving results
93 _TT=Field ("Temperature", CELLS, _mesh, 1);
94 _Alpha=Field ("Void fraction", CELLS, _mesh, 1);
95 _Rho=Field ("Mixture density", CELLS, _mesh, 1);
96 //Construction des champs de post-traitement
97 for(int i =0; i<_Nmailles;i++){
98 _TT(i)=temperature(_VV(i));
99 _Alpha(i)=voidFraction(_VV(i));
100 _Rho(i)=density(_Alpha(i));
102 if(!_heatPowerFieldSet){
103 _heatPowerField=Field("Heat Power",CELLS,_mesh,1);
104 for(int i =0; i<_Nmailles; i++)
105 _heatPowerField(i) = _heatSource;
107 if(!_rodTemperatureFieldSet){
108 _rodTemperatureField=Field("Rod temperature",CELLS,_mesh,1);
109 for(int i =0; i<_Nmailles; i++)
110 _rodTemperatureField(i) = _rodTemperature;
114 _globalNbUnknowns = _Nmailles;
116 /* Vectors creations */
117 VecCreate(PETSC_COMM_WORLD, &_Hn);
118 VecSetSizes(_Hn,PETSC_DECIDE,_Nmailles);
119 VecSetFromOptions(_Hn);
120 VecGetLocalSize(_Hn, &_localNbUnknowns);
122 VecDuplicate(_Hn, &_Hk);
123 VecDuplicate(_Hn, &_Hkm1);
124 VecDuplicate(_Hn, &_deltaH);
125 VecDuplicate(_Hn, &_b);//RHS of the linear system: _b=Hn/dt + _b0 + puisance
126 VecDuplicate(_Hn, &_b0);//part of the RHS that comes from the boundary conditions
128 if(_mpi_rank == 0)//Process 0 reads and distributes initial data
129 for(int i =0; i<_Nmailles;i++)
130 VecSetValue(_Hn,i,_VV(i), INSERT_VALUES);
131 VecAssemblyBegin(_Hn);
134 //creation de la matrice
135 MatCreateAIJ(PETSC_COMM_WORLD, _localNbUnknowns, _localNbUnknowns, _globalNbUnknowns, _globalNbUnknowns, _d_nnz, PETSC_NULL, _o_nnz, PETSC_NULL, &_A);
137 /* Local sequential vector creation */
138 if(_mpi_size>1 && _mpi_rank == 0)
139 VecCreateSeq(PETSC_COMM_SELF,_globalNbUnknowns,&_Hn_seq);//For saving results on proc 0
140 VecScatterCreateToZero(_Hn,&_scat,&_Hn_seq);
144 _initializedMemory=true;
145 save();//save initial data
148 double TransportEquation::computeTimeStep(bool & stop){
149 if(!_transportMatrixSet)
150 _dt_transport=computeTransportMatrix();
152 _dt_src=computeRHS();
154 if(_verbose or _system)
156 PetscPrintf(PETSC_COMM_WORLD,"Right hand side of the linear system\n");
157 VecView(_b,PETSC_VIEWER_STDOUT_WORLD);
161 return min(_dt_transport,_dt_src);
163 double TransportEquation::computeTransportMatrix(){
169 long nbFaces = _mesh.getNumberOfFaces();
173 double inv_dxi, inv_dxj;
174 Vector normale(_Ndim);
177 std::vector< int > idCells;
178 for (int j=0; j<nbFaces;j++){
179 Fj = _mesh.getFace(j);
181 // compute the normal vector corresponding to face j : from idCells[0] to idCells[1]
182 idCells = Fj.getCellsId();
183 Cell1 = _mesh.getCell(idCells[0]);
186 for(int l=0; l<Cell1.getNumberOfFaces(); l++){
187 if (j == Cell1.getFacesId()[l]){
188 for (int idim = 0; idim < _Ndim; ++idim)
189 normale[idim] = Cell1.getNormalVector(l,idim);
193 }else{ // _Ndim = 1 : assume that this is normal mesh : the face index increases in positive direction
194 if (Fj.getNumberOfCells()<2) {
197 else if (j==nbFaces-1)
200 throw CdmathException("TransportEquation::ComputeTimeStep(): computation of normal vector failed");
201 } else if(Fj.getNumberOfCells()==2){
202 if (idCells[0] < idCells[1])
208 //Compute velocity at the face Fj
209 un=normale*_vitesseTransport;
213 // compute 1/dxi = volume of Ci/area of Fj
215 inv_dxi = Fj.getMeasure()/Cell1.getMeasure();
217 inv_dxi = 1/Cell1.getMeasure();
219 // If Fj is on the boundary
220 if (Fj.getNumberOfCells()==1) {
221 if(_verbose && (_nbTimeStep-1)%_freqSave ==0)
223 cout << "face numero " << j << " cellule frontiere " << idCells[0] << " ; vecteur normal=(";
224 for(int p=0; p<_Ndim; p++)
225 cout << normale[p] << ",";
228 nameOfGroup = Fj.getGroupName();
230 if (_limitField[nameOfGroup].bcType==NeumannTransport || _limitField[nameOfGroup].bcType==OutletTransport ){
231 MatSetValue(_A,idm,idm,inv_dxi*un, ADD_VALUES);
233 else if(_limitField[nameOfGroup].bcType==InletTransport || _limitField[nameOfGroup].bcType==DirichletTransport){
235 MatSetValue(_A,idm,idm,inv_dxi*un, ADD_VALUES);
238 hk=_limitField[nameOfGroup].h;
239 VecSetValue(_b0,idm,-inv_dxi*un*hk, ADD_VALUES);
242 else {//bcType=NoneBCTransport
243 cout<<"!!!!!!!!!!!!!!! Error TransportEquation::computeTransportMatrix() !!!!!!!!!!"<<endl;
244 cout<<"!!!!!!!!! Boundary condition not set for boundary named "<<nameOfGroup<< ", _limitField[nameOfGroup].bcType= "<<_limitField[nameOfGroup].bcType<<" !!!!!!!!!!!!!! "<<endl;
245 cout<<"Accepted boundary conditions are NeumannTransport "<<NeumannTransport<< " and InletTransport "<< InletTransport <<endl;
246 throw CdmathException("Boundary condition not accepted");
248 // if Fj is inside the domain
249 } else if (Fj.getNumberOfCells()==2 ){
250 if(_verbose && (_nbTimeStep-1)%_freqSave ==0)
252 cout << "face numero " << j << " cellule gauche " << idCells[0] << " cellule droite " << idCells[1];
253 cout << " ; vecteur normal=(";
254 for(int p=0; p<_Ndim; p++)
255 cout << normale[p] << ",";
258 Cell2 = _mesh.getCell(idCells[1]);
261 inv_dxj = Fj.getMeasure()/Cell2.getMeasure();
263 inv_dxj = 1/Cell2.getMeasure();
266 MatSetValue(_A,idm,idm,inv_dxi*un, ADD_VALUES);
267 MatSetValue(_A,idn,idm,-inv_dxj*un, ADD_VALUES);
270 MatSetValue(_A,idm,idn,inv_dxi*un, ADD_VALUES);
271 MatSetValue(_A,idn,idn,-inv_dxj*un, ADD_VALUES);
275 throw CdmathException("TransportEquation::ComputeTimeStep(): incompatible number of cells around a face");
279 _transportMatrixSet=true;
281 MPI_Bcast(&_maxvp, 1, MPI_DOUBLE, 0, PETSC_COMM_WORLD);
282 PetscPrintf(PETSC_COMM_WORLD, "Maximum conductivity is %.2e, CFL = %.2f, Delta x = %.2e\n",_maxvp,_cfl,_minl);
284 MatAssemblyBegin(_A, MAT_FINAL_ASSEMBLY);
285 MatAssemblyEnd( _A, MAT_FINAL_ASSEMBLY);
286 VecAssemblyBegin(_b0);
287 VecAssemblyEnd( _b0);
289 if(abs(_maxvp)<_precision)
290 throw CdmathException("TransportEquation::computeTransportMatrix(): maximum eigenvalue for time step is zero");
292 return _cfl*_minl/_maxvp;
294 double TransportEquation::computeRHS(){
295 double rhomin=INFINITY;
302 cout<<"Second membre of transport problem"<<endl;
303 for (int i=0; i<_Nmailles;i++){
304 VecSetValue(_b,i,_heatTransfertCoeff*(_rodTemperatureField(i)-_TT(i))/_Rho(i),ADD_VALUES);
305 VecSetValue(_b,i,_heatPowerField(i)/_Rho(i),ADD_VALUES);
307 cout<<_heatPowerField(i)/_Rho(i)<<endl;
312 VecAssemblyBegin(_b);
315 if(_verbose or _system)
317 PetscPrintf(PETSC_COMM_WORLD,"Right hand side of the linear system\n");
318 VecView(_b,PETSC_VIEWER_STDOUT_WORLD);
321 return rhomin*_cpref/_heatTransfertCoeff;
323 void TransportEquation::updatePrimitives()
326 VecScatterBegin(_scat,_Hn,_Hn_seq,INSERT_VALUES,SCATTER_FORWARD);
327 VecScatterEnd( _scat,_Hn,_Hn_seq,INSERT_VALUES,SCATTER_FORWARD);
330 if(_verbose or _system)
332 PetscPrintf(PETSC_COMM_WORLD,"Unknown of the linear system :\n");
333 VecView(_Hn,PETSC_VIEWER_STDOUT_WORLD);
339 for(int i=0; i<_Nmailles; i++)
342 VecGetValues(_Hn_seq, 1, &i, &hi);
344 VecGetValues(_Hn , 1, &i, &hi);
346 _TT(i)=temperature(hi);
347 _Alpha(i)=voidFraction(hi);
348 _Rho(i)=density(_Alpha(i));
353 bool TransportEquation::initTimeStep(double dt){
354 if(_verbose && (_nbTimeStep-1)%_freqSave ==0)
356 PetscPrintf(PETSC_COMM_WORLD,"Matrix of the linear system\n");
357 MatView(_A,PETSC_VIEWER_STDOUT_WORLD);
362 //Remove the contribution from dt to prepare for new time step. The diffusion matrix is not recomputed
363 if(_timeScheme == Implicit)
364 MatShift(_A,-1/_dt+1/dt);
365 //No need to remove the contribution to the right hand side since it is recomputed from scratch at each time step
367 else if(dt>0)//_dt==0, first time step
369 if(_timeScheme == Implicit)
374 PetscPrintf(PETSC_COMM_WORLD,"TransportEquation::initTimeStep %.2e = \n",dt);
375 throw CdmathException("Error TransportEquation::initTimeStep : cannot set time step to zero");
377 //At this stage _b contains _b0 + power + heat exchange
378 VecAXPY(_b, 1/dt, _Hn);
385 void TransportEquation::abortTimeStep(){
386 //Remove contribution of dt to the RHS
387 VecAXPY(_b, -1/_dt, _Hn);
389 //Remove contribution of dt to the matrix
390 if(_timeScheme == Implicit)
396 bool TransportEquation::iterateTimeStep(bool &converged)
400 if(_NEWTON_its>0){//Pas besoin de computeTimeStep à la première iteration de Newton
402 computeTimeStep(stop);
408 VecAXPY(_b, 1/_dt, _Hn);
411 PetscPrintf(PETSC_COMM_WORLD,"Vecteur Hn : \n");
412 VecView(_Hn, PETSC_VIEWER_STDOUT_WORLD);
414 PetscPrintf(PETSC_COMM_WORLD,"Vecteur _b : \n");
415 VecView(_b, PETSC_VIEWER_STDOUT_WORLD);
416 PetscPrintf(PETSC_COMM_WORLD,"Matrice A : \n");
417 MatView(_A,PETSC_VIEWER_STDOUT_WORLD);
420 if(_timeScheme == Explicit)
422 MatMult(_A, _Hn, _Hk);
425 PetscPrintf(PETSC_COMM_WORLD,"Nouveau vecteur Hk: \n");
426 VecView(_Hk, PETSC_VIEWER_STDOUT_WORLD);
429 VecAXPY(_Hk, -1, _b);
432 PetscPrintf(PETSC_COMM_WORLD,"Nouveau vecteur Hk-b: \n");
433 VecView(_Hk, PETSC_VIEWER_STDOUT_WORLD);
439 PetscPrintf(PETSC_COMM_WORLD,"Nouveau vecteur dt*(Hk-b): \n");
440 VecView(_Hk, PETSC_VIEWER_STDOUT_WORLD);
448 #if PETSC_VERSION_GREATER_3_5
449 KSPSetOperators(_ksp, _A, _A);
451 KSPSetOperators(_ksp, _A, _A,SAME_NONZERO_PATTERN);
455 KSPSetComputeEigenvalues(_ksp,PETSC_TRUE);
457 KSPSolve(_ksp, _b, _Hk);
460 KSPGetIterationNumber(_ksp, &_PetscIts);
461 if( _MaxIterLinearSolver < _PetscIts)
462 _MaxIterLinearSolver = _PetscIts;
463 if(_PetscIts>=_maxPetscIts)
465 PetscPrintf(PETSC_COMM_WORLD,"Systeme lineaire : pas de convergence de Petsc. Itérations maximales %d atteintes", _maxPetscIts);
471 VecCopy(_Hk, _deltaH);//ici on a deltaH=Hk
472 VecAXPY(_deltaH, -1, _Hkm1);//On obtient deltaH=Hk-Hkm1
473 VecNorm(_deltaH,NORM_INFINITY,&_erreur_rel);
474 converged = (_erreur_rel <= _precision) ;//converged=convergence des iterations de Newton
482 void TransportEquation::validateTimeStep()
484 VecCopy(_Hk, _deltaH);//ici Hk=Hnp1 donc on a deltaH=Hnp1
485 VecAXPY(_deltaH, -1, _Hn);//On obtient deltaH=Hnp1-Hn
486 VecNorm(_deltaH,NORM_INFINITY,&_erreur_rel);
488 _isStationary =(_erreur_rel <_precision);
496 if((_nbTimeStep-1)%_freqSave ==0 || _isStationary || _time>=_timeMax || _nbTimeStep>=_maxNbOfTimeStep)
498 cout <<"Valeur propre locale max: " << _maxvp << endl;
499 //Find minimum and maximum void fractions
500 double alphamin=INFINITY;
501 double alphamax=-INFINITY;
502 for(int i=0; i<_Nmailles; i++)
504 if(_Alpha(i)>alphamax)
506 if(_Alpha(i)<alphamin)
509 cout<<"Alpha min = " << alphamin << " Alpha max = " << alphamax<<endl;
517 void TransportEquation::terminate(){
521 VecDestroy(&_deltaH);
525 if(_mpi_size>1 && _mpi_rank == 0)
526 VecDestroy(&_Hn_seq);
529 void TransportEquation::save(){
530 PetscPrintf(PETSC_COMM_WORLD,"Saving numerical results at time step number %d \n\n", _nbTimeStep);
531 *_runLogFile<< "Saving numerical results at time step number "<< _nbTimeStep << endl<<endl;
533 string resultFile(_path+"/TransportEquation_");///Results
534 resultFile+=_fileName;
537 _VV.setTime(_time,_nbTimeStep);
538 _TT.setTime(_time,_nbTimeStep);
539 _Alpha.setTime(_time,_nbTimeStep);
540 _Rho.setTime(_time,_nbTimeStep);
542 // create mesh and component info
543 if (_nbTimeStep ==0 || _restartWithNewFileName){
544 if (_restartWithNewFileName)
545 _restartWithNewFileName=false;
546 string suppress ="rm -rf "+resultFile+"_*";
547 system(suppress.c_str());//Nettoyage des précédents calculs identiques
552 _VV.writeVTK(resultFile+"Enthalpy");
553 _TT.writeVTK(resultFile+"Temperature");
554 _Alpha.writeVTK(resultFile+"GasFraction");
555 _Rho.writeVTK(resultFile+"MixtureDensity");
558 _VV.writeMED(resultFile+"Enthalpy");
559 _TT.writeMED(resultFile+"Temperature");
560 _Alpha.writeMED(resultFile+"GasFraction");
561 _Rho.writeMED(resultFile+"MixtureDensity");
564 _VV.writeCSV(resultFile+"Enthalpy");
565 _TT.writeCSV(resultFile+"Temperature");
566 _Alpha.writeCSV(resultFile+"GasFraction");
567 _Rho.writeCSV(resultFile+"MixtureDensity");
571 // do not create mesh
576 _VV.writeVTK(resultFile+"Enthalpy",false);
577 _TT.writeVTK(resultFile+"Temperature",false);
578 _Alpha.writeVTK(resultFile+"GasFraction",false);
579 _Rho.writeVTK(resultFile+"MixtureDensity",false);
582 _VV.writeMED(resultFile+"Enthalpy",false);
583 _TT.writeMED(resultFile+"Temperature",false);
584 _Alpha.writeMED(resultFile+"GasFraction",false);
585 _Rho.writeMED(resultFile+"MixtureDensity",false);
588 _VV.writeCSV(resultFile+"Enthalpy");
589 _TT.writeCSV(resultFile+"Temperature");
590 _Alpha.writeCSV(resultFile+"GasFraction");
591 _Rho.writeCSV(resultFile+"MixtureDensity");
598 vector<string> TransportEquation::getInputFieldsNames()
600 vector<string> result(2);
602 result[0]="HeatPower";
603 result[1]="RodTemperature";
608 vector<string> TransportEquation::getOutputFieldsNames()
610 vector<string> result(4);
612 result[0]="Enthalpy";
613 result[1]="FluidTemperature";
614 result[2]="VoidFraction";
620 Field& TransportEquation::getOutputField(const string& nameField )
622 if(nameField=="FluidTemperature" || nameField=="FLUIDTEMPERATURE" || nameField=="TemperatureFluide" || nameField=="TEMPERATUREFLUIDE")
623 return getFluidTemperatureField();
624 else if(nameField=="Enthalpy" || nameField=="ENTHALPY" || nameField=="Enthalpie" || nameField=="ENTHALPIE" )
625 return getEnthalpyField();
626 else if(nameField=="VoidFraction" || nameField=="VOIDFRACTION" || nameField=="TauxDeVide" || nameField=="TAUXDEVIDE")
627 return getVoidFractionField();
628 else if(nameField=="Density" || nameField=="DENSITY" || nameField=="Densité" || nameField=="DENSITE" )
629 return getDensityField();
632 cout<<"Error : Field name "<< nameField << " does not exist, call getOutputFieldsNames first" << endl;
633 throw CdmathException("TransportEquation::getOutputField error : Unknown Field name");
638 TransportEquation::setInputField(const string& nameField, Field& inputField )
640 if(nameField=="RodTemperature" || nameField=="RODTEMPERATURE" || nameField=="TemperatureCombustible" || nameField=="TEMPERATURECOMBUSTIBLE")
641 return setRodTemperatureField( inputField) ;
642 else if(nameField=="HeatPower" || nameField=="HEATPOWER" || nameField=="PuissanceThermique" || nameField=="PUISSANCETHERMIQUE" )
643 return setHeatPowerField( inputField );
646 cout<<"Error : Field name "<< nameField << " is not an input field name, call getInputFieldsNames first" << endl;
647 throw CdmathException("TransportEquation::setInputField error : Unknown Field name");
652 TransportEquation::setRodTemperatureField(Field rodTemperature){
654 throw CdmathException("!!!!!!!! TransportEquation::setRodTemperatureField() set initial field first");
656 rodTemperature.getMesh().checkFastEquivalWith(_mesh);
657 _rodTemperatureField=rodTemperature;
658 _rodTemperatureFieldSet=true;
659 _isStationary=false;//Source term may be changed after previously reaching a stationary state
663 TransportEquation::setDirichletBoundaryCondition(string groupName, string fileName, string fieldName, int timeStepNumber, int order, int meshLevel, int field_support_type){
664 if(_FECalculation && field_support_type != NODES)
665 cout<<"Warning : finite element simulation should have boundary field on nodes!!! Change parameter field_support_type"<<endl;
666 else if(!_FECalculation && field_support_type == NODES)
667 cout<<"Warning : finite volume simulation should not have boundary field on nodes!!! Change parameter field_support_type"<<endl;
671 switch(field_support_type)
674 VV = Field(fileName, CELLS, fieldName, timeStepNumber, order, meshLevel);
677 VV = Field(fileName, NODES, fieldName, timeStepNumber, order, meshLevel);
680 VV = Field(fileName, FACES, fieldName, timeStepNumber, order, meshLevel);
683 std::ostringstream message;
684 message << "Error TransportEquation::setDirichletBoundaryCondition \n Accepted field support integers are "<< CELLS <<" (for CELLS), "<<NODES<<" (for NODES), and "<< FACES <<" (for FACES)" ;
685 throw CdmathException(message.str().c_str());
687 /* For the moment the boundary value is taken constant equal to zero */
688 _limitField[groupName]=LimitFieldTransport(DirichletTransport,-1, 0,-1);//This line will be deleted when variable BC are properly treated in solverlab
692 TransportEquation::setNeumannBoundaryCondition(string groupName, string fileName, string fieldName, int timeStepNumber, int order, int meshLevel, int field_support_type){
693 if(_FECalculation && field_support_type != NODES)
694 cout<<"Warning : finite element simulation should have boundary field on nodes!!! Change parameter field_support_type"<<endl;
695 else if(!_FECalculation && field_support_type == NODES)
696 cout<<"Warning : finite volume simulation should not have boundary field on nodes!!! Change parameter field_support_type"<<endl;
700 switch(field_support_type)
703 VV = Field(fileName, CELLS, fieldName, timeStepNumber, order, meshLevel);
706 VV = Field(fileName, NODES, fieldName, timeStepNumber, order, meshLevel);
709 VV = Field(fileName, FACES, fieldName, timeStepNumber, order, meshLevel);
712 std::ostringstream message;
713 message << "Error TransportEquation::setNeumannBoundaryCondition \n Accepted field support integers are "<< CELLS <<" (for CELLS), "<<NODES<<" (for NODES), and "<< FACES <<" (for FACES)" ;
714 throw CdmathException(message.str().c_str());
716 /* For the moment the boundary value is taken constant equal to zero */
717 _limitField[groupName]=LimitFieldTransport(NeumannTransport,-1, 0,-1);//This line will be deleted when variable BC are properly treated in solverlab