]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Added more output fields
authormichael <michael@localhost.localdomain>
Mon, 17 May 2021 08:38:46 +0000 (10:38 +0200)
committermichael <michael@localhost.localdomain>
Mon, 17 May 2021 08:38:46 +0000 (10:38 +0200)
CoreFlows/Models/inc/SinglePhase.hxx
CoreFlows/Models/src/SinglePhase.cxx

index 898b77a28db60b2f805c2810f02e6ef59fc7ccb7..a8ccd9135995db7c85563e9b13820cdedf322030 100755 (executable)
@@ -149,11 +149,14 @@ public :
        Field& getPressureField();
        Field& getVelocityField();
        Field& getVelocityXField();
+       Field& getVelocityYField();
+       Field& getVelocityZField();
        Field& getTemperatureField();
        Field& getDensityField();
        Field& getMomentumField();
        Field& getTotalEnergyField();
        Field& getEnthalpyField();
+       Field& getMachNumberField();
 
 protected :
        double  _drho_sur_dp,   _drho_sur_dT;//derivatives of the density rho wrt cv, p, T
@@ -217,7 +220,7 @@ protected :
        void getDensityDerivatives( double pressure, double temperature, double v2);
 
        bool _saveAllFields;
-       Field _Enthalpy, _Pressure, _Density, _Temperature, _Momentum, _TotalEnergy, _Vitesse, _VitesseX, _VitesseY, _VitesseZ;
+       Field _Enthalpy, _Pressure, _Density, _Temperature, _Momentum, _TotalEnergy, _Vitesse, _VitesseX, _VitesseY, _VitesseZ, _MachNumber;
 
        };
 #endif /* SINGLEPHASE_HXX_*/
index fd4dc87544237abf9370f6e10c6f32e0bdd0dea5..96fd1470ae527052a3a09a3015b999d60e1cff24 100755 (executable)
@@ -69,6 +69,7 @@ void SinglePhase::initialize(){
                _Pressure=Field("Pressure",CELLS,_mesh,1);
                _Density=Field("Density",CELLS,_mesh,1);
                _Temperature=Field("Temperature",CELLS,_mesh,1);
+               _MachNumber=Field("MachNumber",CELLS,_mesh,1);
                _VitesseX=Field("Velocity x",CELLS,_mesh,1);
                if(_Ndim>1)
                {
@@ -2885,7 +2886,7 @@ void SinglePhase::save(){
 
        if(_saveAllFields)
        {
-               double p,T,rho, h, vx,vy,vz;
+               double p,T,rho, h, vx,vy,vz,v2;
                int Ii;
                for (long i = 0; i < _Nmailles; i++){
                        Ii = i*_nVar;
@@ -2913,17 +2914,24 @@ void SinglePhase::save(){
                        _Pressure(i)=p;
                        _Temperature(i)=T;
                        _VitesseX(i)=vx;
+                       v2=vx*vx;
                        if(_Ndim>1)
                        {
                                _VitesseY(i)=vy;
+                               v2+=vy*vy;
                                if(_Ndim>2)
+                               {
                                        _VitesseZ(i)=vz;
+                                       v2+=vz*vz;
+                               }
                        }
+                       _MachNumber(i)=sqrt(v2)/_fluides[0]->vitesseSonEnthalpie(h);
                }
                _Enthalpy.setTime(_time,_nbTimeStep);
                _Density.setTime(_time,_nbTimeStep);
                _Pressure.setTime(_time,_nbTimeStep);
                _Temperature.setTime(_time,_nbTimeStep);
+               _MachNumber.setTime(_time,_nbTimeStep);
                _VitesseX.setTime(_time,_nbTimeStep);
                if(_Ndim>1)
                {
@@ -2939,6 +2947,7 @@ void SinglePhase::save(){
                                _Density.writeVTK(allFields+"_Density");
                                _Pressure.writeVTK(allFields+"_Pressure");
                                _Temperature.writeVTK(allFields+"_Temperature");
+                               _MachNumber.writeVTK(allFields+"_MachNumber");
                                _VitesseX.writeVTK(allFields+"_VelocityX");
                                if(_Ndim>1)
                                {
@@ -2952,6 +2961,7 @@ void SinglePhase::save(){
                                _Density.writeMED(allFields+"_Density");
                                _Pressure.writeMED(allFields+"_Pressure");
                                _Temperature.writeMED(allFields+"_Temperature");
+                               _MachNumber.writeMED(allFields+"_MachNumber");
                                _VitesseX.writeMED(allFields+"_VelocityX");
                                if(_Ndim>1)
                                {
@@ -2965,6 +2975,7 @@ void SinglePhase::save(){
                                _Density.writeCSV(allFields+"_Density");
                                _Pressure.writeCSV(allFields+"_Pressure");
                                _Temperature.writeCSV(allFields+"_Temperature");
+                               _MachNumber.writeCSV(allFields+"_MachNumber");
                                _VitesseX.writeCSV(allFields+"_VelocityX");
                                if(_Ndim>1)
                                {
@@ -2983,6 +2994,7 @@ void SinglePhase::save(){
                                _Density.writeVTK(allFields+"_Density",false);
                                _Pressure.writeVTK(allFields+"_Pressure",false);
                                _Temperature.writeVTK(allFields+"_Temperature",false);
+                               _MachNumber.writeVTK(allFields+"_MachNumber",false);
                                _VitesseX.writeVTK(allFields+"_VelocityX",false);
                                if(_Ndim>1)
                                {
@@ -2996,6 +3008,7 @@ void SinglePhase::save(){
                                _Density.writeMED(allFields+"_Density",false);
                                _Pressure.writeMED(allFields+"_Pressure",false);
                                _Temperature.writeMED(allFields+"_Temperature",false);
+                               _MachNumber.writeMED(allFields+"_MachNumber",false);
                                _VitesseX.writeMED(allFields+"_VelocityX",false);
                                if(_Ndim>1)
                                {
@@ -3009,6 +3022,7 @@ void SinglePhase::save(){
                                _Density.writeCSV(allFields+"_Density");
                                _Pressure.writeCSV(allFields+"_Pressure");
                                _Temperature.writeCSV(allFields+"_Temperature");
+                               _MachNumber.writeCSV(allFields+"_MachNumber");
                                _VitesseX.writeCSV(allFields+"_VelocityX");
                                if(_Ndim>1)
                                {