From 616e146104d74e36d3e162dd3ecede7b94ad71b1 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 29 Nov 2020 00:10:49 +0100 Subject: [PATCH] Corrected memory errors --- CoreFlows/Models/src/SinglePhase.cxx | 98 +++++++++++++++------------- 1 file changed, 54 insertions(+), 44 deletions(-) diff --git a/CoreFlows/Models/src/SinglePhase.cxx b/CoreFlows/Models/src/SinglePhase.cxx index eebcb21..c5c27ae 100755 --- a/CoreFlows/Models/src/SinglePhase.cxx +++ b/CoreFlows/Models/src/SinglePhase.cxx @@ -310,7 +310,7 @@ void SinglePhase::computeNewtonVariation() } } void SinglePhase::convectionState( const long &i, const long &j, const bool &IsBord){ - + //First conservative state then further down we will compute interface (Roe) state and then compute primitive state _idm[0] = _nVar*i; for(int k=1; k<_nVar; k++) _idm[k] = _idm[k-1] + 1; @@ -339,6 +339,8 @@ void SinglePhase::convectionState( const long &i, const long &j, const bool &IsB _runLogFile->close(); throw CdmathException("densite negative, arret de calcul"); } + + //Computation of Roe state PetscScalar ri, rj, xi, xj, pi, pj; PetscInt Ii; ri = sqrt(_Ui[0]);//racine carre de phi_i rho_i @@ -385,6 +387,43 @@ void SinglePhase::convectionState( const long &i, const long &j, const bool &IsB for(int k=0;k<_nVar;k++) cout<< _Uroe[k]<<" , "<getConductivity(_Udiff[_nVar-1]); - double mu = _fluides[0]->getViscosity(_Udiff[_nVar-1]); + double lambda = _fluides[0]->getConductivity(_Udiff[_nVar-1]); + double mu = _fluides[0]->getViscosity(_Udiff[_nVar-1]); + + if(isBord ) + lambda=max(lambda,_heatTransfertCoeff);//wall nucleate boing -> larger heat transfer if(lambda==0 && mu ==0 && _heatTransfertCoeff==0) return; - //extraction des valeurs - _idm[0] = _nVar*i; // Kieu + _idm[0] = 0; for(int k=1; k<_nVar; k++) _idm[k] = _idm[k-1] + 1; - - VecGetValues(_primitiveVars, _nVar, _idm, _Vi); - if (_verbose && _nbTimeStep%_freqSave ==0) - { - cout << "Calcul diffusion: variables primitives maille " << i< larger heat transfer - for(int k=0; k<_nVar; k++) - _idn[k] = k; - - VecGetValues(_Uextdiff, _nVar, _idn, _phi); - consToPrim(_phi,_Vj,1); + VecGetValues(_Uextdiff, _nVar, _idm, _Uj); + _inv_dxj=_inv_dxi; } - if (_verbose && _nbTimeStep%_freqSave ==0) - { - cout << "Calcul diffusion: variables primitives maille " <vitesseSonEnthalpie(_Vi[_Ndim+1]-ul_2/2);//vitesse du son a l'interface double cr = _fluides[0]->vitesseSonEnthalpie(_Vj[_Ndim+1]-ur_2/2);//vitesse du son a l'interface -- 2.39.2