diff --git a/.gitmodules b/.gitmodules index 2c655cb36da3..54f834208f58 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,7 +14,7 @@ url = https://github.com/mesonbuild/meson [submodule "subprojects/Mutationpp"] path = subprojects/Mutationpp - url = https://github.com/mutationpp/Mutationpp.git + url = https://github.com/hypersonic-lab/Mutationpp.git [submodule "subprojects/CoolProp"] path = subprojects/CoolProp url = https://github.com/CoolProp/CoolProp.git @@ -27,3 +27,6 @@ [submodule "subprojects/MLPCpp"] path = subprojects/MLPCpp url = https://github.com/EvertBunschoten/MLPCpp.git +[submodule "externals/FADO"] + path = externals/FADO + url = https://github.com/pcarruscag/FADO.git diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index cdb5e0a63a92..1ab11812ce1b 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4024,7 +4024,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (Kind_FluidModel == MUTATIONPP && (Kind_TransCoeffModel == TRANSCOEFFMODEL::GUPTAYOS)) { cout << "Gupta-Yos viscosity model chosen for M++, which is not a thermal conductivity model. Chapman-Enskog default model will be used for Thermal Conductivity." << endl; } - + if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) { if (Kind_FluidModel != FLUID_FLAMELET) { @@ -5474,7 +5474,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Specifying a deforming surface requires a mesh deformation solver. ---*/ if (GetSurface_Movement(DEFORMING)) Deform_Mesh = true; - monoatomic = GetGasModel() == "ARGON"; + monoatomic = StringToUpperCase(GetGasModel()) == "ARGON"; /*--- Set number of Turbulence Variables. ---*/ switch (TurbModelFamily(Kind_Turb_Model)) { @@ -7097,8 +7097,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { break; case EULER_IMPLICIT: cout << "Euler implicit method for the flow equations." << endl; - if (Kind_FluidModel == MUTATIONPP) - SU2_MPI::Error("Implicit time scheme is not yet implemented with Mutation++. Use EULER_EXPLICIT.", CURRENT_FUNCTION); switch (Kind_Linear_Solver) { case BCGSTAB: case FGMRES: diff --git a/SU2_CFD/include/fluid/CMutationTCLib.hpp b/SU2_CFD/include/fluid/CMutationTCLib.hpp index c1b603a8ba25..3fe8cb5d9c19 100644 --- a/SU2_CFD/include/fluid/CMutationTCLib.hpp +++ b/SU2_CFD/include/fluid/CMutationTCLib.hpp @@ -49,7 +49,12 @@ class CMutationTCLib : public CNEMOGas { vector Cv_ks, /*!< \brief Species specific heats at constant volume. */ es, /*!< \brief Species energies. */ - omega_vec; /*!< \brief Dummy vector for vibrational energy source term. */ + omega_vec, /*!< \brief Dummy vector for vibrational energy source term. */ + JacRho, /*!< \brief Dummy vector for partial density dependent chemistry jacobians. */ + JacT, /*!< \brief Dummy vector for translational temperature dependent chemistry jacobians. */ + JacTv, /*!< \brief Dummy vector for vibrational temperature dependent chemistry jacobians. */ + omegaJRho, /*!< \brief Dummy vector for partial density dependent vibrational source term jacobians. */ + omegaJTTv; /*!< \brief Dummy vector for temperature (both tr and ve) dependent vibrational source term jacobians. */ su2double Tref; /*!< \brief Reference temperature. */ @@ -100,11 +105,23 @@ class CMutationTCLib : public CNEMOGas { const su2double* cvve, const su2double* dTdU, const su2double* dTvedU, su2double **val_jacobian) final; + /*! + * \brief Compute chemical source term jacobian elements. + */ + void ChemistryJacobian(unsigned short iReaction, const su2double *V, const su2double* eve, const su2double* cvve, + const su2double* dTdU, const su2double* dTvedU, su2double **val_jacobian) final; + /*! * \brief Compute vibrational energy source term. */ su2double ComputeEveSourceTerm() final; + /*! + * \brief Compute vibrational energy source term jacobian elements. + */ + void GetEveSourceTermJacobian(const su2double *V, const su2double *eve, const su2double *cvve, + const su2double *dTdU, const su2double* dTvedU, su2double **val_jacobian) final; + /*! * \brief Compute species enthalpies. */ diff --git a/SU2_CFD/src/fluid/CMutationTCLib.cpp b/SU2_CFD/src/fluid/CMutationTCLib.cpp index 450df9efcb7c..e772a1175590 100644 --- a/SU2_CFD/src/fluid/CMutationTCLib.cpp +++ b/SU2_CFD/src/fluid/CMutationTCLib.cpp @@ -40,7 +40,11 @@ CMutationTCLib::CMutationTCLib(const CConfig* config, unsigned short val_nDim): es.resize(nEnergyEq*nSpecies,0.0); omega_vec.resize(1,0.0); CatRecombTable.resize(nSpecies,2) = 0; - + JacRho.resize(nSpecies*nSpecies,0.0); + JacT.resize(nSpecies,0.0); + JacTv.resize(nSpecies,0.0); + omegaJRho.resize(nSpecies,0.0); + omegaJTTv.resize(nEnergyEq,0.0); /*--- Set up inputs to define type of mixture in the Mutation++ library ---*/ @@ -157,7 +161,7 @@ vector& CMutationTCLib::GetSpeciesCvTraRot(){ mix->getCvsMass(Cv_ks.data()); for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) Cvtrs[iSpecies] = Cv_ks[iSpecies]; - + return Cvtrs; } @@ -197,9 +201,35 @@ vector& CMutationTCLib::ComputeNetProductionRates(bool implicit, cons mix->netProductionRates(ws.data()); + if(implicit) ChemistryJacobian(0, V, eve, cvve, dTdU, dTvedU, val_jacobian); + return ws; } +void CMutationTCLib::ChemistryJacobian(unsigned short iReaction, const su2double *V, const su2double* eve, const su2double *cvve, + const su2double* dTdU, const su2double* dTvedU, su2double **val_jacobian){ + + unsigned short iVar, jVar, iSpecies; + unsigned short nEve = nSpecies+nDim+1; + unsigned short nVar = nSpecies+nDim+2; + + mix->jacobianRho(JacRho.data()); + mix->jacobianT(JacT.data()); + mix->jacobianTv(JacTv.data()); + + for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for(jSpecies = 0; jSpecies < nSpecies; jSpecies++) + val_jacobian[iSpecies][jSpecies] = JacRho[iSpecies*nSpecies+jSpecies]; + + for(iSpecies = 0; iSpecies < nSpecies; iSpecies++){ + for(iVar = 0; iVar < nVar; iVar++){ + val_jacobian[iSpecies][iVar] += JacT[iSpecies]*dTdU[iVar]; + val_jacobian[iSpecies][iVar] += JacTv[iSpecies]*dTvedU[iVar]; + } + } + +} + su2double CMutationTCLib::ComputeEveSourceTerm(){ mix->energyTransferSource(omega_vec.data()); @@ -209,6 +239,26 @@ su2double CMutationTCLib::ComputeEveSourceTerm(){ return omega; } +void CMutationTCLib::GetEveSourceTermJacobian(const su2double *V, const su2double *eve, const su2double *cvve, const su2double *dTdU, + const su2double* dTvedU, su2double **val_jacobian){ + + unsigned short iVar, jVar, iSpecies; + unsigned short nEve = nSpecies+nDim+1; + unsigned short nVar = nSpecies+nDim+2; + + mix->energyTransferJacobiansRho(omegaJRho.data()); + mix->energyTransferJacobiansTTv(omegaJTTv.data()); + + for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) + val_jacobian[nEve][iSpecies] = omegaJRho[iSpecies]; + + for(iVar = 0; iVar < nVar; iVar++){ + val_jacobian[nEve][iVar] += omegaJTTv[0]*dTdU[iVar]; + val_jacobian[nEve][iVar] += omegaJTTv[1]*dTvedU[iVar]; + } + +} + vector& CMutationTCLib::ComputeSpeciesEnthalpy(su2double val_T, su2double val_Tve, su2double *val_eves){ mix->getEnthalpiesMass(hs.data()); @@ -221,6 +271,7 @@ vector& CMutationTCLib::GetDiffusionCoeff(){ mix->averageDiffusionCoeffs(DiffusionCoeff.data()); return DiffusionCoeff; + } su2double CMutationTCLib::GetViscosity(){ diff --git a/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp b/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp index 14fae045bdad..990b1d3c7034 100644 --- a/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp +++ b/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp @@ -351,6 +351,9 @@ void CNEMONumerics::GetViscousProjJacs(const su2double *val_Mean_PrimVar, case 12: return COMPUTE_VISCOUS_JACS(12, 7); + case 15: + return COMPUTE_VISCOUS_JACS(15,11); + default: return COMPUTE_VISCOUS_JACS(DynamicSize,DynamicSize); diff --git a/meson_scripts/init.py b/meson_scripts/init.py index 4ed6f053dc96..578c8349b589 100755 --- a/meson_scripts/init.py +++ b/meson_scripts/init.py @@ -65,8 +65,8 @@ def init_submodules( github_repo_meson = "https://github.com/mesonbuild/meson" sha_version_ninja = "52649de2c56b63f42bc59513d51286531c595b44" github_repo_ninja = "https://github.com/ninja-build/ninja" - sha_version_mpp = "5ff579f43781cae07411e5ab46291c9971536be6" - github_repo_mpp = "https://github.com/mutationpp/Mutationpp" + sha_version_mpp = "c3c0c51cab2fc42f6c24e7d2d37135a131fd5a16" + github_repo_mpp = "https://github.com/hypersonic-lab/Mutationpp" sha_version_coolprop = "bafdea1f39ee873a6bb9833e3a21fe41f90b85e8" github_repo_coolprop = "https://github.com/CoolProp/CoolProp" sha_version_mel = "46205ab019e5224559091375a6d71aabae6bc5b9" diff --git a/subprojects/Mutationpp b/subprojects/Mutationpp index 5ff579f43781..c3c0c51cab2f 160000 --- a/subprojects/Mutationpp +++ b/subprojects/Mutationpp @@ -1 +1 @@ -Subproject commit 5ff579f43781cae07411e5ab46291c9971536be6 +Subproject commit c3c0c51cab2fc42f6c24e7d2d37135a131fd5a16