diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 794622bb1a1e..8abcc77e4fbe 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -919,6 +919,7 @@ class CConfig { Initial_BCThrust, /*!< \brief Ratio of turbulent to laminar viscosity at the actuator disk. */ Pressure_FreeStream, /*!< \brief Total pressure of the fluid. */ Pressure_Thermodynamic, /*!< \brief Thermodynamic pressure of the fluid. */ + Standard_Ref_Temperature, /*!< \brief Standard reference temperature for multicomponent flows. */ Temperature_FreeStream, /*!< \brief Total temperature of the fluid. */ Temperature_ve_FreeStream; /*!< \brief Total vibrational-electronic temperature of the fluid. */ unsigned short wallModel_MaxIter; /*!< \brief maximum number of iterations for the Newton method for the wall model */ @@ -1958,6 +1959,12 @@ class CConfig { */ su2double GetPressure_Thermodynamic(void) const { return Pressure_Thermodynamic; } + /*! + * \brief Get the value of the standard reference temperature for multicomponent flows. + * \return Standard reference temperature, Non-dimensionalized if it is needed for Non-Dimensional problems. + */ + su2double GetStandard_RefTemperatureND(void) const { return Standard_Ref_Temperature / Temperature_Ref; } + /*! * \brief Get the value of the non-dimensionalized thermodynamic pressure. * \return Non-dimensionalized thermodynamic pressure. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index c37a471be58e..8a84e679ab69 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1229,6 +1229,9 @@ void CConfig::SetConfig_Options() { addDoubleOption("GAMMA_VALUE", Gamma, 1.4); /*!\brief THERMODYNAMIC_PRESSURE \n DESCRIPTION: Thermodynamics(operating) Pressure (101325 Pa), only for incompressible flows) \ingroup Config*/ addDoubleOption("THERMODYNAMIC_PRESSURE", Pressure_Thermodynamic, 101325.0); + /*!\brief STANDARD_REFERENCE_TEMPERATURE \n DESCRIPTION: Standard reference temperature (298.15K), only for + * multicomponent incompressible flows) \ingroup Config*/ + addDoubleOption("STANDARD_REFERENCE_TEMPERATURE", Standard_Ref_Temperature, 298.15); /*!\brief CP_VALUE \n DESCRIPTION: Specific heat at constant pressure, Cp (1004.703 J/kg*K (air), constant density incompressible fluids only) \ingroup Config*/ addDoubleListOption("SPECIFIC_HEAT_CP", nSpecific_Heat_Cp, Specific_Heat_Cp); /*!\brief THERMAL_EXPANSION_COEFF \n DESCRIPTION: Thermal expansion coefficient (0.00347 K^-1 (air), used for Boussinesq approximation for liquids/non-ideal gases) \ingroup Config*/ diff --git a/SU2_CFD/include/fluid/CConstantDensity.hpp b/SU2_CFD/include/fluid/CConstantDensity.hpp index a452661be5cc..acfeed2e0cf0 100644 --- a/SU2_CFD/include/fluid/CConstantDensity.hpp +++ b/SU2_CFD/include/fluid/CConstantDensity.hpp @@ -56,5 +56,16 @@ class CConstantDensity final : public CFluidModel { decoupled equation. Hence, we update the value. Note Cp = Cv, (gamma = 1).*/ Temperature = t; + Enthalpy = Cp * Temperature; + } + + /*! + * \brief Set the Dimensionless State using Enthalpy. + * \param[in] val_enthalpy - Enthalpy value at the point. + * \param[in] val_scalars - not used here. + */ + void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override { + Enthalpy = val_enthalpy; + Temperature = Enthalpy / Cp; } }; diff --git a/SU2_CFD/include/fluid/CFluidFlamelet.hpp b/SU2_CFD/include/fluid/CFluidFlamelet.hpp index 3c72eee242d9..0b94512d10d1 100644 --- a/SU2_CFD/include/fluid/CFluidFlamelet.hpp +++ b/SU2_CFD/include/fluid/CFluidFlamelet.hpp @@ -118,6 +118,13 @@ class CFluidFlamelet final : public CFluidModel { */ void SetTDState_T(su2double val_temperature, const su2double* val_scalars = nullptr) override; + /*! + * \brief Set the thermodynamic state. + * \param[in] val_enthalpy - enthalpy + * \param[in] val_scalars - pointer to species mass fractions + */ + void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override; + /*! * \brief Evaluate data-set for flamelet simulations. * \param[in] input_scalar - controlling variables used to interpolate manifold. diff --git a/SU2_CFD/include/fluid/CFluidModel.hpp b/SU2_CFD/include/fluid/CFluidModel.hpp index f84eab9eb63a..03f1e7d66052 100644 --- a/SU2_CFD/include/fluid/CFluidModel.hpp +++ b/SU2_CFD/include/fluid/CFluidModel.hpp @@ -47,6 +47,7 @@ class CLookUpTable; class CFluidModel { protected: su2double StaticEnergy{0.0}; /*!< \brief Internal Energy. */ + su2double Enthalpy{0.0}; /*!<*\brief Enthalpy. */ su2double Entropy{0.0}; /*!< \brief Entropy. */ su2double Density{0.0}; /*!< \brief Density. */ su2double Pressure{0.0}; /*!< \brief Pressure. */ @@ -113,6 +114,11 @@ class CFluidModel { */ su2double GetStaticEnergy() const { return StaticEnergy; } + /*! + * \brief Get fluid enthalpy. + */ + su2double GetEnthalpy() const { return Enthalpy; } + /*! * \brief Get fluid density. */ @@ -186,6 +192,30 @@ class CFluidModel { return mass_diffusivity; } + /*! + * \brief Get the enthalpy diffusivity terms for all species being solved. + * + * This function computes and retrieves the enthalpy diffusion terms required in the energy equation + * for multicomponent flows. + * + * \param[in,out] enthalpy_diffusions - Array containing the enthalpy diffusion terms for all + * species to be solved. The size of \p enthalpy_diffusions must be at least (n_species_mixture - 1), + * corresponding to the number of species transport equations in the system. + */ + virtual void GetEnthalpyDiffusivity(su2double* enthalpy_diffusions = nullptr) const {} + + /*! + * \brief Get the gradient of enthalpy diffusivity terms for all species being solved. + * + * This function computes and retrieves the gradient of the enthalpy diffusion terms with respect to temperature. + * These terms are required for implicit computations when solving the energy equation for multicomponent flows. + * + * \param[in,out] grad_enthalpy_diffusions - Array containing the gradient of enthalpy diffusion terms for all + * species to be solved. The size of \p grad_enthalpy_diffusions must be at least (n_species_mixture - 1), + * corresponding to the number of species transport equations in the system. + */ + virtual void GetGradEnthalpyDiffusivity(su2double* grad_enthalpy_diffusions = nullptr) const {} + /*! * \brief Get fluid pressure partial derivative. */ @@ -339,6 +369,13 @@ class CFluidModel { */ virtual void SetTDState_T(su2double val_Temperature, const su2double* val_scalars = nullptr) {} + /*! + * \brief Virtual member. + * \param[in] val_enthalpy - Enthalpy value at the point. + * \param[in] val_scalars - Scalar mass fractions. + */ + virtual void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) {} + /*! * \brief Set fluid eddy viscosity provided by a turbulence model needed for computing effective thermal conductivity. */ diff --git a/SU2_CFD/include/fluid/CFluidScalar.hpp b/SU2_CFD/include/fluid/CFluidScalar.hpp index cd1c6e50c210..164043872d6a 100644 --- a/SU2_CFD/include/fluid/CFluidScalar.hpp +++ b/SU2_CFD/include/fluid/CFluidScalar.hpp @@ -40,10 +40,12 @@ class CFluidScalar final : public CFluidModel { private: const int n_species_mixture; /*!< \brief Number of species in mixture. */ - su2double Gas_Constant; /*!< \brief Specific gas constant. */ + su2double Gas_Constant; /*!< \brief Specific gas constant. */ const su2double Pressure_Thermodynamic; /*!< \brief Constant pressure thermodynamic. */ + const su2double Ref_Temperature; /*!< \brief Standard Reference temperature, usually set to 298.15 K. */ const su2double GasConstant_Ref; /*!< \brief Gas constant reference needed for Nondimensional problems. */ - const su2double Prandtl_Number; /*!< \brief Prandlt number.*/ + const su2double Prandtl_Turb_Number; /*!< \brief Prandlt turbulent number.*/ + const su2double Schmidt_Turb_Number; /*!< \brief Schmidt turbulent number.*/ const bool wilke; const bool davidson; @@ -91,6 +93,11 @@ class CFluidScalar final : public CFluidModel { */ su2double ComputeMeanSpecificHeatCp(const su2double* val_scalars); + /*! + * \brief Compute Enthalpy given the temperature and scalars. + */ + su2double ComputeEnthalpyFromT(const su2double val_temperature, const su2double* val_scalars); + /*! * \brief Compute gas constant for mixture. */ @@ -130,16 +137,47 @@ class CFluidScalar final : public CFluidModel { /*! * \brief Get fluid thermal conductivity. */ - inline su2double GetThermalConductivity() override { return Kt + Mu_Turb * Cp / Prandtl_Number; } + inline su2double GetThermalConductivity() override { return Kt + Mu_Turb * Cp / Prandtl_Turb_Number; } /*! * \brief Get fluid mass diffusivity. */ inline su2double GetMassDiffusivity(int ivar) override { return massDiffusivity[ivar]; } + /*! + * \brief Get the enthalpy diffusivity terms for all species being solved. + * + * This function computes and retrieves the enthalpy diffusion terms required in the energy equation + * for multicomponent flows. + * + * \param[in,out] enthalpy_diffusions - Array containing the enthalpy diffusion terms for all + * species to be solved. The size of \p enthalpy_diffusions must be at least (n_species_mixture - 1), + * corresponding to the number of species transport equations in the system. + */ + void GetEnthalpyDiffusivity(su2double* enthalpy_diffusions) const override; + + /*! + * \brief Get the gradient of enthalpy diffusivity terms for all species being solved. + * + * This function computes and retrieves the gradient of the enthalpy diffusion terms with respect to temperature. + * These terms are required for implicit computations when solving the energy equation for multicomponent flows. + * + * \param[in,out] grad_enthalpy_diffusions - Array containing the gradient of enthalpy diffusion terms for all + * species to be solved. The size of \p grad_enthalpy_diffusions must be at least (n_species_mixture - 1), + * corresponding to the number of species transport equations in the system. + */ + void GetGradEnthalpyDiffusivity(su2double* grad_enthalpy_diffusions) const override; + /*! * \brief Set the Dimensionless State using Temperature. * \param[in] t - Temperature value at the point. */ void SetTDState_T(su2double val_temperature, const su2double* val_scalars) override; + + /*! + * \brief Virtual member. + * \param[in] val_enthalpy - Enthalpy value at the point. + * \param[in] val_scalars - Scalar mass fractions. + */ + void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override; }; diff --git a/SU2_CFD/include/fluid/CIncIdealGas.hpp b/SU2_CFD/include/fluid/CIncIdealGas.hpp index d8bb21af5941..16266e569568 100644 --- a/SU2_CFD/include/fluid/CIncIdealGas.hpp +++ b/SU2_CFD/include/fluid/CIncIdealGas.hpp @@ -58,6 +58,17 @@ class CIncIdealGas final : public CFluidModel { /*--- The EoS only depends upon temperature. ---*/ Temperature = t; Density = Pressure / (Temperature * Gas_Constant); + Enthalpy = Cp * Temperature; + } + + /*! + * \brief Set the Dimensionless State using Enthalpy. + * \param[in] val_enthalpy - Enthalpy value at the point. + */ + void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override { + Enthalpy = val_enthalpy; + Temperature = Enthalpy / Cp; + Density = Pressure / (Temperature * Gas_Constant); } private: diff --git a/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp b/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp index 06cfa616adb5..e1f5f1d9105c 100644 --- a/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp +++ b/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp @@ -58,9 +58,15 @@ class CIncIdealGasPolynomial final : public CFluidModel { * \param[in] config - configuration container for the problem. */ void SetCpModel(const CConfig* config) override { + const su2double t_ref = config->GetStandard_RefTemperatureND(); + Enthalpy_Ref = 0.0; + su2double t_i = 1.0; for (int i = 0; i < N; ++i) { + t_i *= t_ref; coeffs_[i] = config->GetCp_PolyCoeffND(i); + Enthalpy_Ref += coeffs_[i] * t_i / (i + 1); } + Temperature_Min = config->GetTemperatureLimits(0); } /*! @@ -72,18 +78,70 @@ class CIncIdealGasPolynomial final : public CFluidModel { Temperature = t; Density = Pressure / (Temperature * Gas_Constant); - /* Evaluate the new Cp from the coefficients and temperature. */ + /* Evaluate the new Cp and enthalpy from the coefficients and temperature. */ Cp = coeffs_[0]; + Enthalpy = coeffs_[0] * t - Enthalpy_Ref; su2double t_i = 1.0; for (int i = 1; i < N; ++i) { t_i *= t; Cp += coeffs_[i] * t_i; + Enthalpy += coeffs_[i] * t_i * t / (i + 1); + } + Cv = Cp / Gamma; + } + + /*! + * \brief Set the Dimensionless State using enthalpy. + * \param[in] val_enthalpy - Enthalpy value at the point. + */ + void SetTDState_h(su2double val_enthalpy, const su2double* val_scalars = nullptr) override { + Enthalpy = val_enthalpy; + /*--- convergence criterion for temperature in [K], high accuracy needed for restarts. ---*/ + const su2double toll = 1e-5; + su2double temp_iter = 300.0; + su2double Cp_iter = 0.0; + su2double delta_temp_iter = 1e10; + su2double delta_enthalpy_iter; + const int counter_limit = 20; + + int counter = 0; + + /*--- Computing temperature given enthalpy using Newton-Raphson. ---*/ + while ((abs(delta_temp_iter) > toll) && (counter++ < counter_limit)) { + /* Evaluate the new Cp and enthalpy from the coefficients and temperature. */ + Cp_iter = coeffs_[0]; + su2double Enthalpy_iter = coeffs_[0] * temp_iter - Enthalpy_Ref; + su2double t_i = 1.0; + for (int i = 1; i < N; ++i) { + t_i *= temp_iter; + Cp_iter += coeffs_[i] * t_i; + Enthalpy_iter += coeffs_[i] * t_i * temp_iter / (i + 1); + } + + delta_enthalpy_iter = Enthalpy - Enthalpy_iter; + + delta_temp_iter = delta_enthalpy_iter / Cp_iter; + + temp_iter += delta_temp_iter; + if (temp_iter < Temperature_Min) { + cout << "Warning: Negative temperature has been found during Newton-Raphson" << endl; + temp_iter = Temperature_Min; + break; + } + } + Temperature = temp_iter; + Cp = Cp_iter; + if (counter == counter_limit) { + cout << "Warning Newton-Raphson exceed number of max iteration in temperature computation" << endl; } + Density = Pressure / (Temperature * Gas_Constant); Cv = Cp / Gamma; } private: su2double Gas_Constant{0.0}; /*!< \brief Specific Gas Constant. */ su2double Gamma{0.0}; /*!< \brief Ratio of specific heats. */ - array coeffs_; /*!< \brief Polynomial coefficients for conductivity as a function of temperature. */ + array coeffs_; /*!< \brief Polynomial coefficients for heat capacity as a function of temperature. */ + su2double Enthalpy_Ref; /*!< \brief Enthalpy computed at the reference temperature. */ + su2double Temperature_Min; /*!< \brief Minimum temperature value allowed in Newton-Raphson iterations. */ }; diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index d5fb6a0ec11e..90c3a2e4cc4f 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -129,6 +129,10 @@ class CNumerics { const su2double *ScalarVar_i, /*!< \brief Vector of scalar variables at point i. */ *ScalarVar_j; /*!< \brief Vector of scalar variables at point j. */ + su2double + HeatFluxDiffusion; /*!< \brief Heat flux due to enthalpy diffusion for multicomponent. */ + su2double + JacHeatFluxDiffusion; /*!< \brief Heat flux jacobian due to enthalpy diffusion for multicomponent. */ const su2double *TransVar_i, /*!< \brief Vector of turbulent variables at point i. */ *TransVar_j; /*!< \brief Vector of turbulent variables at point j. */ @@ -187,6 +191,8 @@ class CNumerics { bool nemo; /*!< \brief Flag for NEMO problems */ + bool energy_multicomponent = false; /*!< \brief Flag for multicomponent and reacting flow */ + bool bounded_scalar = false; /*!< \brief Flag for bounded scalar problem */ public: @@ -750,6 +756,20 @@ class CNumerics { Diffusion_Coeff_j = val_diffusioncoeff_j; } + /*! + * \brief Set the heat flux due to enthalpy diffusion + * \param[in] val_heatfluxdiffusion - Value of the heat flux due to enthalpy diffusion. + */ + inline void SetHeatFluxDiffusion(su2double val_heatfluxdiffusion) { HeatFluxDiffusion = val_heatfluxdiffusion; } + + /*! + * \brief Set Jacobian of the heat flux due to enthalpy diffusion + * \param[in] val_jacheatfluxdiffusion - Value of the heat flux jacobian due to enthalpy diffusion. + */ + inline void SetJacHeatFluxDiffusion(su2double val_jacheatfluxdiffusion) { + JacHeatFluxDiffusion = val_jacheatfluxdiffusion; + } + /*! * \brief Set the laminar viscosity. * \param[in] val_laminar_viscosity_i - Value of the laminar viscosity at point i. @@ -1038,8 +1058,7 @@ class CNumerics { * \param[in] val_density - Value of the density. * \param[in] val_velocity - Pointer to the velocity. * \param[in] val_betainc2 - Value of the artificial compresibility factor. - * \param[in] val_cp - Value of the specific heat at constant pressure. - * \param[in] val_temperature - Value of the temperature. + * \param[in] val_enthalpy - Value of the enthalpy. * \param[in] val_dRhodT - Value of the derivative of density w.r.t. temperature. * \param[in] val_normal - Normal vector, the norm of the vector is the area of the face. * \param[in] val_scale - Scale of the projection. @@ -1048,8 +1067,7 @@ class CNumerics { void GetInviscidIncProjJac(const su2double *val_density, const su2double *val_velocity, const su2double *val_betainc2, - const su2double *val_cp, - const su2double *val_temperature, + const su2double *val_enthalpy, const su2double *val_dRhodT, const su2double *val_normal, su2double val_scale, @@ -1060,17 +1078,15 @@ class CNumerics { * \param[in] val_density - Value of the density. * \param[in] val_velocity - Pointer to the velocity. * \param[in] val_betainc2 - Value of the artificial compresibility factor. - * \param[in] val_cp - Value of the specific heat at constant pressure. - * \param[in] val_temperature - Value of the temperature. - * \param[in] val_dRhodT - Value of the derivative of density w.r.t. temperature. + * \param[in] val_enthalpy - Value of the enthalpy. + * \param[in] val_dRhodh - Value of the derivative of density w.r.t. enthalpy. * \param[out] val_Precon - Pointer to the preconditioning matrix. */ void GetPreconditioner(const su2double *val_density, const su2double *val_velocity, const su2double *val_betainc2, - const su2double *val_cp, - const su2double *val_temperature, - const su2double *val_drhodt, + const su2double *val_enthalpy, + const su2double *val_drhodh, su2double **val_Precon) const; /*! diff --git a/SU2_CFD/include/numerics/flow/convection/centered.hpp b/SU2_CFD/include/numerics/flow/convection/centered.hpp index 45d03f340a68..e8c1c3813b10 100644 --- a/SU2_CFD/include/numerics/flow/convection/centered.hpp +++ b/SU2_CFD/include/numerics/flow/convection/centered.hpp @@ -49,7 +49,7 @@ class CCentLaxInc_Flow final : public CNumerics { MeanDensity, MeanPressure, MeanBetaInc2, MeanEnthalpy, MeanCp, MeanTemperature, /*!< \brief Mean values of primitive variables. */ - MeandRhodT, /*!< \brief Derivative of density w.r.t. temperature (variable density flows). */ + MeandRhodh, /*!< \brief Derivative of density w.r.t. enthalpy (variable density flows). */ Param_p, Param_Kappa_0, /*!< \brief Artificial dissipation parameters. */ Local_Lambda_i, Local_Lambda_j, MeanLambda, /*!< \brief Local eingenvalues. */ @@ -109,7 +109,7 @@ class CCentJSTInc_Flow final : public CNumerics { MeanDensity, MeanPressure, MeanBetaInc2, MeanEnthalpy, MeanCp, MeanTemperature, /*!< \brief Mean values of primitive variables. */ - MeandRhodT, /*!< \brief Derivative of density w.r.t. temperature (variable density flows). */ + MeandRhodh, /*!< \brief Derivative of density w.r.t. enthalpy (variable density flows). */ Param_p, Param_Kappa_2, Param_Kappa_4, /*!< \brief Artificial dissipation parameters. */ Local_Lambda_i, Local_Lambda_j, diff --git a/SU2_CFD/include/numerics/flow/convection/fds.hpp b/SU2_CFD/include/numerics/flow/convection/fds.hpp index e4a4382a0988..a1f3a0d970d2 100644 --- a/SU2_CFD/include/numerics/flow/convection/fds.hpp +++ b/SU2_CFD/include/numerics/flow/convection/fds.hpp @@ -49,7 +49,7 @@ class CUpwFDSInc_Flow final : public CNumerics { su2double **Precon, **invPrecon_A; su2double Proj_ModJac_Tensor_ij, Pressure_i, Pressure_j, ProjVelocity, - MeandRhodT, dRhodT_i, dRhodT_j, /*!< \brief Derivative of density w.r.t. temperature (variable density flows). */ + MeandRhodh, dRhodh_i, dRhodh_j, /*!< \brief Derivative of density w.r.t. enthalpy (variable density flows). */ Temperature_i, Temperature_j, /*!< \brief Temperature at node 0 and 1. */ MeanDensity, MeanPressure, MeanSoundSpeed, MeanBetaInc2, MeanEnthalpy, MeanCp, MeanTemperature; /*!< \brief Mean values of primitive variables. */ unsigned short iDim, iVar, jVar, kVar; diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index 231fe0c0337e..1ffddd096e67 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -126,7 +126,8 @@ class CSourceGeneralAxisymmetric_Flow final : public CSourceAxisymmetric_Flow { class CSourceIncAxisymmetric_Flow final : public CSourceBase_Flow { bool implicit, /*!< \brief Implicit calculation. */ viscous, /*!< \brief Viscous incompressible flows. */ - energy; /*!< \brief computation with the energy equation. */ + energy, /*!< \brief computation with the energy equation. */ + multicomponent; /*!< \brief multicomponent incompressible flows. */ public: /*! diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index e6f10ff2eaf7..362e2d51c4b0 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -69,7 +69,8 @@ class CFVMFlowSolverBase : public CSolver { su2double Mach_Inf = 0.0; /*!< \brief Mach number at the infinity. */ su2double Density_Inf = 0.0; /*!< \brief Density at the infinity. */ su2double Energy_Inf = 0.0; /*!< \brief Energy at the infinity. */ - su2double Temperature_Inf = 0.0; /*!< \brief Energy at the infinity. */ + su2double Temperature_Inf = 0.0; /*!< \brief Temperature at the infinity. */ + su2double Enthalpy_Inf = 0.0; /*!< \brief Enthalpy at the infinity. */ su2double Pressure_Inf = 0.0; /*!< \brief Pressure at the infinity. */ su2double* Velocity_Inf = nullptr; /*!< \brief Flow Velocity vector at the infinity. */ diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 54fd616d0de8..8e6803d69465 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -203,6 +203,19 @@ class CIncEulerSolver : public CFVMFlowSolverBase struct CIndices { @@ -52,18 +52,18 @@ class CIncEulerVariable : public CFlowVariable { inline IndexType Velocity() const { return 1; } inline IndexType Temperature() const { return nDim+1; } inline IndexType Density() const { return nDim+2; } - inline IndexType Beta() const { return nDim+3; } + inline IndexType Enthalpy() const { return nDim+3; } + inline IndexType Beta() const { return nDim+4; } inline IndexType SoundSpeed() const { return Beta(); } - inline IndexType LaminarViscosity() const { return nDim+4; } - inline IndexType EddyViscosity() const { return nDim+5; } - inline IndexType ThermalConductivity() const { return nDim+6; } - inline IndexType CpTotal() const { return nDim+7; } - inline IndexType CvTotal() const { return nDim+8; } + inline IndexType LaminarViscosity() const { return nDim+5; } + inline IndexType EddyViscosity() const { return nDim+6; } + inline IndexType ThermalConductivity() const { return nDim+7; } + inline IndexType CpTotal() const { return nDim+8; } + inline IndexType CvTotal() const { return nDim+9; } /*--- For compatible interface with NEMO. ---*/ inline IndexType SpeciesDensities() const { return std::numeric_limits::max(); } inline IndexType Temperature_ve() const { return std::numeric_limits::max(); } - inline IndexType Enthalpy() const { return std::numeric_limits::max(); } }; protected: @@ -72,6 +72,7 @@ class CIncEulerVariable : public CFlowVariable { VectorType Streamwise_Periodic_RecoveredPressure, /*!< \brief Recovered/Physical pressure [Pa] for streamwise periodic flow. */ Streamwise_Periodic_RecoveredTemperature; /*!< \brief Recovered/Physical temperature [K] for streamwise periodic flow. */ su2double TemperatureLimits[2]; /*!< \brief Temperature limits [K]. */ + su2double TemperatureInc = 0.0; /*!< \brief Temperature [K] imposed when energy equation is switch off. */ public: /*! * \brief Constructor of the class. @@ -123,6 +124,14 @@ class CIncEulerVariable : public CFlowVariable { return (val_temperature <= val_temp_limits[0]) || (val_temperature >= val_temp_limits[1]); } + /*! + * \brief Set the value of the enthalpy for multicomponent incompressible flows with energy equation. + * \param[in] iPoint - Point index. + */ + inline void SetEnthalpy(unsigned long iPoint, su2double val_enthalpy) { + Primitive(iPoint, indices.Enthalpy()) = val_enthalpy; + } + /*! * \brief Set the value of the beta coeffient for incompressible flows. * \param[in] iPoint - Point index. @@ -155,6 +164,12 @@ class CIncEulerVariable : public CFlowVariable { */ inline su2double GetTemperature(unsigned long iPoint) const final { return Primitive(iPoint, indices.Temperature()); } + /*! + * \brief Get the enthalpy of the flow. + * \return Value of the enthalpy of the flow. + */ + inline su2double GetEnthalpy(unsigned long iPoint) const final { return Primitive(iPoint, indices.Enthalpy()); } + /*! * \brief Get the velocity of the flow. * \param[in] iDim - Index of the dimension. diff --git a/SU2_CFD/include/variables/CIncNSVariable.hpp b/SU2_CFD/include/variables/CIncNSVariable.hpp index 5e254506b84f..f9bf112f9819 100644 --- a/SU2_CFD/include/variables/CIncNSVariable.hpp +++ b/SU2_CFD/include/variables/CIncNSVariable.hpp @@ -40,6 +40,7 @@ class CIncNSVariable final : public CIncEulerVariable { private: VectorType Tau_Wall; /*!< \brief Magnitude of the wall shear stress from a wall function. */ VectorType DES_LengthScale; + const bool Energy; /*!< \brief Flag for Energy equation in incompressible flows. */ public: /*! diff --git a/SU2_CFD/src/fluid/CFluidFlamelet.cpp b/SU2_CFD/src/fluid/CFluidFlamelet.cpp index fd1417b3f56d..f6fd529df832 100644 --- a/SU2_CFD/src/fluid/CFluidFlamelet.cpp +++ b/SU2_CFD/src/fluid/CFluidFlamelet.cpp @@ -117,12 +117,24 @@ CFluidFlamelet::~CFluidFlamelet() { #endif } +void CFluidFlamelet::SetTDState_h(su2double val_enthalpy, const su2double* val_scalars) { + /*--- For the fluid flamelet model, the enthalpy (and the temperature) are passive scalars. + val_scalars contains the enthalpy as the second variable: val_scalars= (Progress_variable, enthalpy,...). + Consequently, the energy equation is not solved when the fluid flamelet model is used; instead the energy equation for + enthalpy is solved in the species flamelet solver, and the enthalpy solution is overwritten in the CIncEulerSolver. + Likewise, The temperature is retrieved from the look up table. Then, the thermodynamics state is fully determined with + the val_scalars. This is the reason why enthalpy (or temperature) can be passed in either SetTDSTtate_T or + SetTDState_h without affecting the solution.---*/ + SetTDState_T(val_enthalpy, val_scalars); +} + void CFluidFlamelet::SetTDState_T(su2double val_temperature, const su2double* val_scalars) { for (auto iVar = 0u; iVar < n_scalars; iVar++) scalars_vector[iVar] = val_scalars[iVar]; /*--- Add all quantities and their names to the look up vectors. ---*/ EvaluateDataSet(scalars_vector, FLAMELET_LOOKUP_OPS::THERMO, val_vars_TD); + Enthalpy = scalars_vector[1]; Temperature = val_vars_TD[LOOKUP_TD::TEMPERATURE]; Cp = val_vars_TD[LOOKUP_TD::HEATCAPACITY]; Mu = val_vars_TD[LOOKUP_TD::VISCOSITY]; diff --git a/SU2_CFD/src/fluid/CFluidScalar.cpp b/SU2_CFD/src/fluid/CFluidScalar.cpp index a1433c78d280..b42cf7b70433 100644 --- a/SU2_CFD/src/fluid/CFluidScalar.cpp +++ b/SU2_CFD/src/fluid/CFluidScalar.cpp @@ -45,8 +45,10 @@ CFluidScalar::CFluidScalar(su2double value_pressure_operating, const CConfig* co : CFluidModel(), n_species_mixture(config->GetnSpecies() + 1), Pressure_Thermodynamic(value_pressure_operating), + Ref_Temperature(config->GetStandard_RefTemperatureND()), GasConstant_Ref(config->GetGas_Constant_Ref()), - Prandtl_Number(config->GetPrandtl_Turb()), + Prandtl_Turb_Number(config->GetPrandtl_Turb()), + Schmidt_Turb_Number(config->GetSchmidt_Number_Turbulent()), wilke(config->GetKind_MixingViscosityModel() == MIXINGVISCOSITYMODEL::WILKE), davidson(config->GetKind_MixingViscosityModel() == MIXINGVISCOSITYMODEL::DAVIDSON) { if (n_species_mixture > ARRAYSIZE) { @@ -168,7 +170,7 @@ su2double CFluidScalar::DavidsonViscosity(const su2double* val_scalars) { su2double CFluidScalar::WilkeConductivity(const su2double* val_scalars) { for (int iVar = 0; iVar < n_species_mixture; iVar++) { - ThermalConductivityPointers[iVar]->SetConductivity(Temperature, Density, Mu, 0.0, 0.0, 0.0, 0.0); + ThermalConductivityPointers[iVar]->SetConductivity(Temperature, Density, Mu, 0.0, Cp, 0.0, 0.0); laminarThermalConductivity[iVar] = ThermalConductivityPointers[iVar]->GetConductivity(); } @@ -212,6 +214,35 @@ su2double CFluidScalar::ComputeMeanSpecificHeatCp(const su2double* val_scalars) return mean_cp; } +su2double CFluidScalar::ComputeEnthalpyFromT(const su2double val_temperature, const su2double* val_scalars){ + /* In future implementations, enthalpy should be computed using numerical integration. For now, as Cp does not + * depend on temperature, but it does depend on mixture composition, enthalpy is directly computed from + * the expression h_s = Cp(T - T_ref). + */ + su2double val_Enthalpy = Cp * (val_temperature - Ref_Temperature); + return val_Enthalpy; +} + +void CFluidScalar::GetEnthalpyDiffusivity(su2double* enthalpy_diffusions) const { + const su2double enthalpy_species_N = specificHeat[n_species_mixture - 1] * (Temperature - Ref_Temperature); + for (int iVar = 0; iVar < n_species_mixture - 1; iVar++) { + const su2double enthalpy_species_i = specificHeat[iVar] * (Temperature - Ref_Temperature); + enthalpy_diffusions[iVar] = Density * (enthalpy_species_i * massDiffusivity[iVar] - + enthalpy_species_N * massDiffusivity[n_species_mixture - 1]); + enthalpy_diffusions[iVar] += Mu_Turb * (enthalpy_species_i - enthalpy_species_N) / Schmidt_Turb_Number; + } +} + +void CFluidScalar::GetGradEnthalpyDiffusivity(su2double* grad_enthalpy_diffusions) const { + for (int iVar = 0; iVar < n_species_mixture - 1; iVar++) { + grad_enthalpy_diffusions[iVar] = Density * + (specificHeat[iVar] * massDiffusivity[iVar] - + specificHeat[n_species_mixture - 1] * massDiffusivity[n_species_mixture - 1]); + grad_enthalpy_diffusions[iVar] += + Mu_Turb * (specificHeat[iVar] - specificHeat[n_species_mixture - 1]) / Schmidt_Turb_Number; + } +} + void CFluidScalar::SetTDState_T(const su2double val_temperature, const su2double* val_scalars) { MassToMoleFractions(val_scalars); ComputeGasConstant(); @@ -219,6 +250,7 @@ void CFluidScalar::SetTDState_T(const su2double val_temperature, const su2double Density = Pressure_Thermodynamic / (Temperature * Gas_Constant); Cp = ComputeMeanSpecificHeatCp(val_scalars); Cv = Cp - Gas_Constant; + Enthalpy = ComputeEnthalpyFromT(Temperature, val_scalars); if (wilke) { Mu = WilkeViscosity(val_scalars); @@ -229,3 +261,25 @@ void CFluidScalar::SetTDState_T(const su2double val_temperature, const su2double Kt = WilkeConductivity(val_scalars); ComputeMassDiffusivity(); } + +void CFluidScalar::SetTDState_h(const su2double val_enthalpy, const su2double* val_scalars) { + MassToMoleFractions(val_scalars); + ComputeGasConstant(); + Enthalpy = val_enthalpy; + Cp = ComputeMeanSpecificHeatCp(val_scalars); + /* In future implementations, temperature should be computed using Newton-Raphson. For now, as Cp does not + * depend on temperature, but it does depend on mixture composition, temperature is directly solved from the + * expression h_s = Cp(T - T_ref). + */ + Temperature = val_enthalpy / Cp + Ref_Temperature; + Density = Pressure_Thermodynamic / (Temperature * Gas_Constant); + Cv = Cp - Gas_Constant; + + if (wilke) { + Mu = WilkeViscosity(val_scalars); + } else if (davidson) { + Mu = DavidsonViscosity(val_scalars); + } + + Kt = WilkeConductivity(val_scalars); +} diff --git a/SU2_CFD/src/numerics/CNumerics.cpp b/SU2_CFD/src/numerics/CNumerics.cpp index bf43edf64f55..5944c333c131 100644 --- a/SU2_CFD/src/numerics/CNumerics.cpp +++ b/SU2_CFD/src/numerics/CNumerics.cpp @@ -53,6 +53,7 @@ CNumerics::CNumerics(unsigned short val_nDim, unsigned short val_nVar, Gamma_Minus_One = Gamma - 1.0; Prandtl_Turb = config->GetPrandtl_Turb(); Gas_Constant = config->GetGas_ConstantND(); + energy_multicomponent = config->GetKind_FluidModel() == FLUID_MIXTURE && config->GetEnergy_Equation(); tau = new su2double* [nDim]; for (iDim = 0; iDim < nDim; iDim++) @@ -248,10 +249,9 @@ void CNumerics::GetInviscidProjJac(const su2double *val_velocity, const su2doubl } void CNumerics::GetInviscidIncProjJac(const su2double *val_density, const su2double *val_velocity, - const su2double *val_betainc2, const su2double *val_cp, - const su2double *val_temperature, const su2double *val_dRhodT, - const su2double *val_normal, su2double val_scale, - su2double **val_Proj_Jac_Tensor) const { + const su2double *val_betainc2, const su2double *val_enthalpy, + const su2double *val_dRhodT, const su2double *val_normal, + su2double val_scale, su2double **val_Proj_Jac_Tensor) const { const bool wasActive = AD::BeginPassive(); unsigned short iDim; su2double proj_vel; @@ -277,10 +277,10 @@ void CNumerics::GetInviscidIncProjJac(const su2double *val_density, const su2dou val_Proj_Jac_Tensor[2][2] = val_scale*((*val_density)*(proj_vel + val_normal[1]*val_velocity[1])); val_Proj_Jac_Tensor[2][3] = val_scale*((*val_dRhodT)*val_velocity[1]*proj_vel); - val_Proj_Jac_Tensor[3][0] = val_scale*((*val_cp)*(*val_temperature)*proj_vel/(*val_betainc2)); - val_Proj_Jac_Tensor[3][1] = val_scale*((*val_cp)*(*val_temperature)*val_normal[0]*(*val_density)); - val_Proj_Jac_Tensor[3][2] = val_scale*((*val_cp)*(*val_temperature)*val_normal[1]*(*val_density)); - val_Proj_Jac_Tensor[3][3] = val_scale*((*val_cp)*((*val_temperature)*(*val_dRhodT) + (*val_density))*proj_vel); + val_Proj_Jac_Tensor[3][0] = val_scale*((*val_enthalpy)*proj_vel/(*val_betainc2)); + val_Proj_Jac_Tensor[3][1] = val_scale*((*val_enthalpy)*val_normal[0]*(*val_density)); + val_Proj_Jac_Tensor[3][2] = val_scale*((*val_enthalpy)*val_normal[1]*(*val_density)); + val_Proj_Jac_Tensor[3][3] = val_scale*(((*val_enthalpy)*(*val_dRhodT) + (*val_density))*proj_vel); } else { @@ -308,26 +308,25 @@ void CNumerics::GetInviscidIncProjJac(const su2double *val_density, const su2dou val_Proj_Jac_Tensor[3][3] = val_scale*((*val_density)*(proj_vel + val_normal[2]*val_velocity[2])); val_Proj_Jac_Tensor[3][4] = val_scale*((*val_dRhodT)*val_velocity[2]*proj_vel); - val_Proj_Jac_Tensor[4][0] = val_scale*((*val_cp)*(*val_temperature)*proj_vel/(*val_betainc2)); - val_Proj_Jac_Tensor[4][1] = val_scale*((*val_cp)*(*val_temperature)*val_normal[0]*(*val_density)); - val_Proj_Jac_Tensor[4][2] = val_scale*((*val_cp)*(*val_temperature)*val_normal[1]*(*val_density)); - val_Proj_Jac_Tensor[4][3] = val_scale*((*val_cp)*(*val_temperature)*val_normal[2]*(*val_density)); - val_Proj_Jac_Tensor[4][4] = val_scale*((*val_cp)*((*val_temperature)*(*val_dRhodT) + (*val_density))*proj_vel); + val_Proj_Jac_Tensor[4][0] = val_scale*((*val_enthalpy)*proj_vel/(*val_betainc2)); + val_Proj_Jac_Tensor[4][1] = val_scale*((*val_enthalpy)*val_normal[0]*(*val_density)); + val_Proj_Jac_Tensor[4][2] = val_scale*((*val_enthalpy)*val_normal[1]*(*val_density)); + val_Proj_Jac_Tensor[4][3] = val_scale*((*val_enthalpy)*val_normal[2]*(*val_density)); + val_Proj_Jac_Tensor[4][4] = val_scale*(((*val_enthalpy)*(*val_dRhodT) + (*val_density))*proj_vel); } AD::EndPassive(wasActive); } void CNumerics::GetPreconditioner(const su2double *val_density, const su2double *val_velocity, - const su2double *val_betainc2, const su2double *val_cp, - const su2double *val_temperature, const su2double *val_drhodt, - su2double **val_Precon) const { + const su2double *val_betainc2, const su2double *val_enthalpy, + const su2double *val_drhodh, su2double **val_Precon) const { unsigned short iDim, jDim; val_Precon[0][0] = 1.0/(*val_betainc2); for (iDim = 0; iDim < nDim; iDim++) val_Precon[iDim+1][0] = val_velocity[iDim]/(*val_betainc2); - val_Precon[nDim+1][0] = (*val_cp)*(*val_temperature)/(*val_betainc2); + val_Precon[nDim+1][0] = *val_enthalpy /(*val_betainc2); for (jDim = 0; jDim < nDim; jDim++) { val_Precon[0][jDim+1] = 0.0; @@ -338,10 +337,10 @@ void CNumerics::GetPreconditioner(const su2double *val_density, const su2double val_Precon[nDim+1][jDim+1] = 0.0; } - val_Precon[0][nDim+1] = (*val_drhodt); + val_Precon[0][nDim+1] = (*val_drhodh); for (iDim = 0; iDim < nDim; iDim++) - val_Precon[iDim+1][nDim+1] = val_velocity[iDim]*(*val_drhodt); - val_Precon[nDim+1][nDim+1] = (*val_cp)*((*val_drhodt)*(*val_temperature) + (*val_density)); + val_Precon[iDim+1][nDim+1] = val_velocity[iDim]*(*val_drhodh); + val_Precon[nDim+1][nDim+1] = (*val_drhodh)*(*val_enthalpy) + (*val_density); } diff --git a/SU2_CFD/src/numerics/flow/convection/centered.cpp b/SU2_CFD/src/numerics/flow/convection/centered.cpp index ba66bd66c185..3d1b85502659 100644 --- a/SU2_CFD/src/numerics/flow/convection/centered.cpp +++ b/SU2_CFD/src/numerics/flow/convection/centered.cpp @@ -95,9 +95,9 @@ CNumerics::ResidualType<> CCentLaxInc_Flow::ComputeResidual(const CConfig* confi Pressure_i = V_i[0]; Pressure_j = V_j[0]; Temperature_i = V_i[nDim+1]; Temperature_j = V_j[nDim+1]; DensityInc_i = V_i[nDim+2]; DensityInc_j = V_j[nDim+2]; - BetaInc2_i = V_i[nDim+3]; BetaInc2_j = V_j[nDim+3]; - Cp_i = V_i[nDim+7]; Cp_j = V_j[nDim+7]; - Enthalpy_i = Cp_i*Temperature_i; Enthalpy_j = Cp_j*Temperature_j; + BetaInc2_i = V_i[nDim+4]; BetaInc2_j = V_j[nDim+4]; + Cp_i = V_i[nDim+8]; Cp_j = V_j[nDim+8]; + Enthalpy_i = V_i[nDim+3]; Enthalpy_j = V_j[nDim+3]; Area = 0.0; sq_vel_i = 0.0; sq_vel_j = 0.0; ProjVelocity_i = 0.0; ProjVelocity_j = 0.0; @@ -126,9 +126,9 @@ CNumerics::ResidualType<> CCentLaxInc_Flow::ComputeResidual(const CConfig* confi preconditioning matrix. For now, the only option is the ideal gas law, but in the future, dRhodT should be in the fluid model. ---*/ - MeandRhodT = 0.0; + MeandRhodh = 0.0; if (variable_density) { - MeandRhodT = -MeanDensity/MeanTemperature; + MeandRhodh = -MeanDensity/(MeanTemperature * MeanCp); } /*--- Get projected flux tensor ---*/ @@ -138,7 +138,7 @@ CNumerics::ResidualType<> CCentLaxInc_Flow::ComputeResidual(const CConfig* confi /*--- Jacobians of the inviscid flux ---*/ if (implicit) { - GetInviscidIncProjJac(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanCp, &MeanTemperature, &MeandRhodT, Normal, 0.5, Jacobian_i); + GetInviscidIncProjJac(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanEnthalpy, &MeandRhodh, Normal, 0.5, Jacobian_i); for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) { Jacobian_j[iVar][jVar] = Jacobian_i[iVar][jVar]; @@ -167,24 +167,23 @@ CNumerics::ResidualType<> CCentLaxInc_Flow::ComputeResidual(const CConfig* confi /*--- Jacobian contributions ---*/ /*--- Implicit terms ---*/ if (implicit) { - for (iDim = 0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim+1; iDim++){ Jacobian_i[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_i; Jacobian_j[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_j; } - Jacobian_i[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_i*Cp_i; - Jacobian_j[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_j*Cp_j; } } } /*--- Computes differences btw. conservative variables ---*/ - for (iVar = 0; iVar < nVar; iVar++) + for (iVar = 0; iVar < nVar - 1; iVar++) Diff_V[iVar] = V_i[iVar]-V_j[iVar]; + Diff_V[nVar - 1] = Enthalpy_i - Enthalpy_j; /*--- Build the preconditioning matrix using mean values ---*/ - GetPreconditioner(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanCp, &MeanTemperature, &MeandRhodT, Precon); + GetPreconditioner(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanEnthalpy, &MeandRhodh, Precon); /*--- Compute the local espectral radius of the preconditioned system and the stretching factor. ---*/ @@ -318,9 +317,9 @@ CNumerics::ResidualType<> CCentJSTInc_Flow::ComputeResidual(const CConfig* confi Pressure_i = V_i[0]; Pressure_j = V_j[0]; Temperature_i = V_i[nDim+1]; Temperature_j = V_j[nDim+1]; DensityInc_i = V_i[nDim+2]; DensityInc_j = V_j[nDim+2]; - BetaInc2_i = V_i[nDim+3]; BetaInc2_j = V_j[nDim+3]; - Cp_i = V_i[nDim+7]; Cp_j = V_j[nDim+7]; - Enthalpy_i = Cp_i*Temperature_i; Enthalpy_j = Cp_j*Temperature_j; + BetaInc2_i = V_i[nDim+4]; BetaInc2_j = V_j[nDim+4]; + Cp_i = V_i[nDim+8]; Cp_j = V_j[nDim+8]; + Enthalpy_i = V_i[nDim+3]; Enthalpy_j = V_j[nDim+3]; Area = 0.0; sq_vel_i = 0.0; sq_vel_j = 0.0; ProjVelocity_i = 0.0; ProjVelocity_j = 0.0; @@ -349,9 +348,9 @@ CNumerics::ResidualType<> CCentJSTInc_Flow::ComputeResidual(const CConfig* confi preconditioning matrix. For now, the only option is the ideal gas law, but in the future, dRhodT should be in the fluid model. ---*/ - MeandRhodT = 0.0; + MeandRhodh = 0.0; if (variable_density) { - MeandRhodT = -MeanDensity/MeanTemperature; + MeandRhodh = -MeanDensity/(MeanTemperature*MeanCp); } /*--- Get projected flux tensor ---*/ @@ -361,7 +360,7 @@ CNumerics::ResidualType<> CCentJSTInc_Flow::ComputeResidual(const CConfig* confi /*--- Jacobians of the inviscid flux ---*/ if (implicit) { - GetInviscidIncProjJac(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanCp, &MeanTemperature, &MeandRhodT, Normal, 0.5, Jacobian_i); + GetInviscidIncProjJac(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanEnthalpy, &MeandRhodh, Normal, 0.5, Jacobian_i); for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) { Jacobian_j[iVar][jVar] = Jacobian_i[iVar][jVar]; @@ -391,12 +390,10 @@ CNumerics::ResidualType<> CCentJSTInc_Flow::ComputeResidual(const CConfig* confi /*--- Jacobian contributions ---*/ /*--- Implicit terms ---*/ if (implicit) { - for (iDim = 0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim+1; iDim++){ Jacobian_i[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_i; Jacobian_j[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_j; } - Jacobian_i[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_i*Cp_i; - Jacobian_j[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_j*Cp_j; } } } @@ -405,12 +402,17 @@ CNumerics::ResidualType<> CCentJSTInc_Flow::ComputeResidual(const CConfig* confi for (iVar = 0; iVar < nVar; iVar++) { Diff_Lapl[iVar] = Und_Lapl_i[iVar]-Und_Lapl_j[iVar]; - Diff_V[iVar] = V_i[iVar]-V_j[iVar]; + if (iVar == nVar - 1) { + Diff_V[iVar] = Enthalpy_i - Enthalpy_j; + } else { + Diff_V[iVar] = V_i[iVar] - V_j[iVar]; + } } + /*--- Build the preconditioning matrix using mean values ---*/ - GetPreconditioner(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanCp, &MeanTemperature, &MeandRhodT, Precon); + GetPreconditioner(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanEnthalpy, &MeandRhodh, Precon); /*--- Compute the local spectral radius of the preconditioned system and the stretching factor. ---*/ diff --git a/SU2_CFD/src/numerics/flow/convection/fds.cpp b/SU2_CFD/src/numerics/flow/convection/fds.cpp index f868bc5e70fa..8b7e0338b3cf 100644 --- a/SU2_CFD/src/numerics/flow/convection/fds.cpp +++ b/SU2_CFD/src/numerics/flow/convection/fds.cpp @@ -94,7 +94,7 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config su2double ProjGridVel = 0.0; AD::StartPreacc(); - AD::SetPreaccIn(V_i, nDim+9); AD::SetPreaccIn(V_j, nDim+9); AD::SetPreaccIn(Normal, nDim); + AD::SetPreaccIn(V_i, nDim+10); AD::SetPreaccIn(V_j, nDim+10); AD::SetPreaccIn(Normal, nDim); if (dynamic_grid) { AD::SetPreaccIn(GridVel_i, nDim); AD::SetPreaccIn(GridVel_j, nDim); @@ -116,9 +116,9 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config Pressure_i = V_i[0]; Pressure_j = V_j[0]; Temperature_i = V_i[nDim+1]; Temperature_j = V_j[nDim+1]; DensityInc_i = V_i[nDim+2]; DensityInc_j = V_j[nDim+2]; - BetaInc2_i = V_i[nDim+3]; BetaInc2_j = V_j[nDim+3]; - Cp_i = V_i[nDim+7]; Cp_j = V_j[nDim+7]; - Enthalpy_i = Cp_i*Temperature_i; Enthalpy_j = Cp_j*Temperature_j; + BetaInc2_i = V_i[nDim+4]; BetaInc2_j = V_j[nDim+4]; + Cp_i = V_i[nDim+8]; Cp_j = V_j[nDim+8]; + Enthalpy_i = V_i[nDim+3]; Enthalpy_j = V_j[nDim+3]; ProjVelocity = 0.0; for (iDim = 0; iDim < nDim; iDim++) { @@ -155,11 +155,11 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config preconditioning matrix. For now, the only option is the ideal gas law, but in the future, dRhodT should be in the fluid model. ---*/ - MeandRhodT = 0.0; dRhodT_i = 0.0; dRhodT_j = 0.0; + MeandRhodh = 0.0; dRhodh_i = 0.0; dRhodh_j = 0.0; if (variable_density) { - MeandRhodT = -MeanDensity/MeanTemperature; - dRhodT_i = -DensityInc_i/Temperature_i; - dRhodT_j = -DensityInc_j/Temperature_j; + MeandRhodh = -MeanDensity / (MeanTemperature * MeanCp); + dRhodh_i = -DensityInc_i / (Temperature_i * Cp_i); + dRhodh_j = -DensityInc_j / (Temperature_j * Cp_j); } /*--- Compute ProjFlux_i ---*/ @@ -192,8 +192,7 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config Lambda[iVar] = fabs(Lambda[iVar]); /*--- Build the preconditioning matrix using mean values ---*/ - - GetPreconditioner(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanCp, &MeanTemperature, &MeandRhodT, Precon); + GetPreconditioner(&MeanDensity, MeanVelocity, &MeanBetaInc2, &MeanEnthalpy, &MeandRhodh, Precon); /*--- Build the absolute value of the preconditioned Jacobian, i.e., |A_precon| = P x |Lambda| x inv(P), where P diagonalizes the matrix @@ -206,13 +205,15 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config Diff_V[0] = Pressure_j - Pressure_i; for (iDim = 0; iDim < nDim; iDim++) Diff_V[iDim+1] = Velocity_j[iDim] - Velocity_i[iDim]; - Diff_V[nDim+1] = Temperature_j - Temperature_i; + Diff_V[nDim + 1] = Enthalpy_j - Enthalpy_i; /*--- Build the inviscid Jacobian w.r.t. the primitive variables ---*/ if (implicit) { - GetInviscidIncProjJac(&DensityInc_i, Velocity_i, &BetaInc2_i, &Cp_i, &Temperature_i, &dRhodT_i, Normal, 0.5, Jacobian_i); - GetInviscidIncProjJac(&DensityInc_j, Velocity_j, &BetaInc2_j, &Cp_j, &Temperature_j, &dRhodT_j, Normal, 0.5, Jacobian_j); + GetInviscidIncProjJac(&DensityInc_i, Velocity_i, &BetaInc2_i, &Enthalpy_i, &dRhodh_i, Normal, 0.5, + Jacobian_i); + GetInviscidIncProjJac(&DensityInc_j, Velocity_j, &BetaInc2_j, &Enthalpy_j, &dRhodh_j, Normal, 0.5, + Jacobian_j); } /*--- Compute dissipation as Precon x |A_precon| x dV. If implicit, @@ -258,8 +259,8 @@ CNumerics::ResidualType<> CUpwFDSInc_Flow::ComputeResidual(const CConfig *config Jacobian_i[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_i; Jacobian_j[iDim+1][iDim+1] -= 0.5*ProjVelocity*DensityInc_j; } - Jacobian_i[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_i*Cp_i; - Jacobian_j[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_j*Cp_j; + Jacobian_i[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_i; + Jacobian_j[nDim+1][nDim+1] -= 0.5*ProjVelocity*DensityInc_j; } } } diff --git a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp index dff4abf037fa..824562ac30ee 100644 --- a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp +++ b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp @@ -552,6 +552,9 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi AD::SetPreaccIn(turb_ke_i); AD::SetPreaccIn(turb_ke_j); AD::SetPreaccIn(TauWall_i); AD::SetPreaccIn(TauWall_j); AD::SetPreaccIn(Normal, nDim); + if (energy_multicomponent) { + AD::SetPreaccIn(HeatFluxDiffusion); + } unsigned short iVar, jVar, iDim; @@ -579,9 +582,9 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi /*--- Density and transport properties ---*/ - Laminar_Viscosity_i = V_i[nDim+4]; Laminar_Viscosity_j = V_j[nDim+4]; - Eddy_Viscosity_i = V_i[nDim+5]; Eddy_Viscosity_j = V_j[nDim+5]; - Thermal_Conductivity_i = V_i[nDim+6]; Thermal_Conductivity_j = V_j[nDim+6]; + Laminar_Viscosity_i = V_i[nDim+5]; Laminar_Viscosity_j = V_j[nDim+5]; + Eddy_Viscosity_i = V_i[nDim+6]; Eddy_Viscosity_j = V_j[nDim+6]; + Thermal_Conductivity_i = V_i[nDim+7]; Thermal_Conductivity_j = V_j[nDim+7]; /*--- Mean transport properties ---*/ @@ -624,6 +627,10 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi GetViscousIncProjFlux(Mean_GradPrimVar, Normal, Mean_Thermal_Conductivity); + if (energy_multicomponent) { + Proj_Flux_Tensor[nVar - 1] += HeatFluxDiffusion; + } + /*--- Implicit part ---*/ if (implicit) { @@ -648,8 +655,13 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi proj_vector_ij += (Coord_j[iDim]-Coord_i[iDim])*Normal[iDim]; } proj_vector_ij = proj_vector_ij/dist_ij_2; - Jacobian_i[nDim+1][nDim+1] = -Mean_Thermal_Conductivity*proj_vector_ij; - Jacobian_j[nDim+1][nDim+1] = Mean_Thermal_Conductivity*proj_vector_ij; + Mean_Cp = 0.5 * (V_i[nDim + 8] + V_j[nDim + 8]); + Jacobian_i[nDim + 1][nDim + 1] = -Mean_Thermal_Conductivity * proj_vector_ij / Mean_Cp; + Jacobian_j[nDim + 1][nDim + 1] = Mean_Thermal_Conductivity * proj_vector_ij / Mean_Cp; + if (energy_multicomponent){ + Jacobian_i[nDim + 1][nDim + 1] -= JacHeatFluxDiffusion / Mean_Cp; + Jacobian_j[nDim + 1][nDim + 1] += JacHeatFluxDiffusion / Mean_Cp; + } } } diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 9ca21be09f12..c4b0a962f6e5 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -245,7 +245,7 @@ CSourceIncAxisymmetric_Flow::CSourceIncAxisymmetric_Flow(unsigned short val_nDim implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); energy = config->GetEnergy_Equation(); viscous = config->GetViscous(); - + multicomponent = (config->GetKind_FluidModel() == FLUID_MIXTURE); } CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CConfig* config) { @@ -259,12 +259,11 @@ CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CCo /*--- Set primitive variables at points iPoint. ---*/ - const su2double Temp_i = V_i[nDim+1]; Pressure_i = V_i[0]; DensityInc_i = V_i[nDim+2]; - BetaInc2_i = V_i[nDim+3]; - Cp_i = V_i[nDim+7]; - Enthalpy_i = Cp_i*Temp_i; + BetaInc2_i = V_i[nDim+4]; + Cp_i = V_i[nDim+8]; + Enthalpy_i = V_i[nDim+3]; for (iDim = 0; iDim < nDim; iDim++) Velocity_i[iDim] = V_i[iDim+1]; @@ -296,7 +295,7 @@ CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CCo jacobian[3][0] = 0.0; jacobian[3][1] = 0.0; jacobian[3][2] = Enthalpy_i; - jacobian[3][3] = Cp_i*Velocity_i[1]; + jacobian[3][3] = Velocity_i[1]; for (iVar=0; iVar < nVar; iVar++) for (jVar=0; jVar < nVar; jVar++) @@ -308,9 +307,9 @@ CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CCo if (viscous) { - Laminar_Viscosity_i = V_i[nDim+4]; - Eddy_Viscosity_i = V_i[nDim+5]; - Thermal_Conductivity_i = V_i[nDim+6]; + Laminar_Viscosity_i = V_i[nDim+5]; + Eddy_Viscosity_i = V_i[nDim+6]; + Thermal_Conductivity_i = V_i[nDim+7]; su2double total_viscosity; @@ -326,8 +325,11 @@ CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CCo residual[2] -= Volume*(yinv*2.0*total_viscosity*PrimVar_Grad_i[2][1] - yinv* yinv*2.0*total_viscosity*Velocity_i[1] - TWO3*AuxVar_Grad_i[0][1]); - residual[3] -= Volume*yinv*Thermal_Conductivity_i*PrimVar_Grad_i[nDim+1][1]; - + residual[3] -= Volume * yinv * Thermal_Conductivity_i * PrimVar_Grad_i[nDim + 1][1]; + if (multicomponent && energy) { + residual[3] -= Volume * yinv * HeatFluxDiffusion; + if (implicit) jacobian[3][3] -= Volume * yinv * JacHeatFluxDiffusion / Cp_i; + } } } else { @@ -821,8 +823,7 @@ CNumerics::ResidualType<> CSourceRadiation::ComputeResidual(const CConfig *confi /*--- Jacobian is set to zero on initialization. ---*/ - jacobian[nDim+1][nDim+1] = -RadVar_Source[1]*Volume; - + jacobian[nDim + 1][nDim + 1] = -RadVar_Source[1] * Volume / Cp_i; } return ResidualType<>(residual, jacobian, nullptr); diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index 6525816bd6aa..2c46229940da 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -111,10 +111,14 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config) { if (nDim == 3) { AddHistoryOutput("RMS_ADJ_VELOCITY-Z", "rms[A_W]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint Velocity z-component.", HistoryFieldType::RESIDUAL); } - /// DESCRIPTION: Maximum residual of the temperature. - if (heat || weakly_coupled_heat) { + /// DESCRIPTION: Root-mean square residual of the adjoint temperature. + if (weakly_coupled_heat) { AddHistoryOutput("RMS_ADJ_TEMPERATURE", "rms[A_T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); } + /// DESCRIPTION: Root-mean square residual of the adjoint enthalpy. + if (heat) { + AddHistoryOutput("RMS_ADJ_ENTHALPY", "rms[A_h]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the enthalpy.", HistoryFieldType::RESIDUAL); + } if (config->GetKind_Streamwise_Periodic() == ENUM_STREAMWISE_PERIODIC::MASSFLOW) { AddHistoryOutput("ADJOINT_SOLEXTRA", "Adjoint_SolExtra", ScreenOutputFormat::FIXED, "ADJOINT_SOLEXTRA", "Adjoint value of the first extra Solution.", HistoryFieldType::COEFFICIENT); @@ -139,10 +143,14 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config) { if (nDim == 3) { AddHistoryOutput("MAX_ADJ_VELOCITY-Z", "max[A_RhoW]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint Velocity z-component", HistoryFieldType::RESIDUAL); } - /// DESCRIPTION: Maximum residual of the temperature. - if (heat || weakly_coupled_heat) { + /// DESCRIPTION: Maximum residual of the adjoint temperature. + if (weakly_coupled_heat) { AddHistoryOutput("MAX_ADJ_TEMPERATURE", "max[A_T]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the temperature.", HistoryFieldType::RESIDUAL); } + /// DESCRIPTION: Maximum residual of the adjoint enthalpy. + if (heat) { + AddHistoryOutput("MAX_ADJ_ENTHALPY", "max[A_h]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the enthalpy.", HistoryFieldType::RESIDUAL); + } AddHistoryOutputFields_AdjScalarMAX_RES(config); /// END_GROUP @@ -158,10 +166,14 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config) { if (nDim == 3) { AddHistoryOutput("BGS_ADJ_VELOCITY-Z", "bgs[A_RhoW]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Velocity z-component", HistoryFieldType::RESIDUAL); } - /// DESCRIPTION: BGS residual of the temperature. - if (heat || weakly_coupled_heat) { + /// DESCRIPTION: BGS residual of the adjoint temperature. + if (weakly_coupled_heat) { AddHistoryOutput("BGS_ADJ_TEMPERATURE", "bgs[A_T]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); } + /// DESCRIPTION: BGS residual of the adjoint enthalpy. + if (heat) { + AddHistoryOutput("BGS_ADJ_ENTHALPY", "bgs[A_h]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint enthalpy.", HistoryFieldType::RESIDUAL); + } AddHistoryOutputFields_AdjScalarBGS_RES(config); @@ -213,8 +225,7 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS SetHistoryOutputValue("RMS_ADJ_TEMPERATURE", log10(adjheat_solver->GetRes_RMS(0))); } if (heat) { - if (nDim == 3) SetHistoryOutputValue("RMS_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_RMS(4))); - else SetHistoryOutputValue("RMS_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_RMS(3))); + SetHistoryOutputValue("RMS_ADJ_ENTHALPY", log10(adjflow_solver->GetRes_RMS(nDim + 1))); } if (config->AddRadiation()) { @@ -235,8 +246,10 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS SetHistoryOutputValue("MAX_ADJ_TEMPERATURE", log10(adjheat_solver->GetRes_Max(0))); } if (heat) { - if (nDim == 3) SetHistoryOutputValue("MAX_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_Max(4))); - else SetHistoryOutputValue("MAX_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_Max(3))); + if (nDim == 3) + SetHistoryOutputValue("MAX_ADJ_ENTHALPY", log10(adjflow_solver->GetRes_Max(4))); + else + SetHistoryOutputValue("MAX_ADJ_ENTHALPY", log10(adjflow_solver->GetRes_Max(3))); } if (multiZone) { @@ -250,8 +263,10 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS SetHistoryOutputValue("BGS_ADJ_TEMPERATURE", log10(adjheat_solver->GetRes_BGS(0))); } if (heat) { - if (nDim == 3) SetHistoryOutputValue("BGS_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_BGS(4))); - else SetHistoryOutputValue("BGS_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_BGS(3))); + if (nDim == 3) + SetHistoryOutputValue("BGS_ADJ_ENTHALPY", log10(adjflow_solver->GetRes_BGS(4))); + else + SetHistoryOutputValue("BGS_ADJ_ENTHALPY", log10(adjflow_solver->GetRes_BGS(3))); } if (config->AddRadiation()) { @@ -298,7 +313,13 @@ void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config) { /// DESCRIPTION: Adjoint Velocity z-component. AddVolumeOutput("ADJ_VELOCITY-Z", "Adjoint_Velocity_z", "SOLUTION", "z-component of the adjoint velocity vector"); } - AddVolumeOutput("ADJ_TEMPERATURE", "Adjoint_Temperature", "SOLUTION", "Adjoint temperature"); + if (weakly_coupled_heat) { + /// DESCRIPTION: Adjoint Temperature. + AddVolumeOutput("ADJ_TEMPERATURE", "Adjoint_Temperature", "SOLUTION", "Adjoint temperature"); + } else { + /// DESCRIPTION: Adjoint Enthalpy. + AddVolumeOutput("ADJ_ENTHALPY", "Adjoint_Enthalpy", "SOLUTION", "Adjoint_Enthalpy"); + } SetVolumeOutputFieldsAdjScalarSolution(config); @@ -328,7 +349,11 @@ void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config) { AddVolumeOutput("RES_ADJ_VELOCITY-Z", "Residual_Adjoint_Velocity_z", "RESIDUAL", "Residual of the adjoint z-velocity"); } /// DESCRIPTION: Residual of the adjoint energy. - AddVolumeOutput("RES_ADJ_TEMPERATURE", "Residual_Adjoint_Heat", "RESIDUAL", "Residual of the adjoint temperature"); + if (weakly_coupled_heat) { + AddVolumeOutput("RES_ADJ_TEMPERATURE", "Residual_Adjoint_Heat", "RESIDUAL", "Residual of the adjoint temperature"); + } else { + AddVolumeOutput("RES_ADJ_ENTHALPY", "Residual_Adjoint_Heat", "RESIDUAL", "Residual of the adjoint enthalpy"); + } SetVolumeOutputFieldsAdjScalarResidual(config); @@ -381,10 +406,11 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo if (weakly_coupled_heat) { SetVolumeOutputValue("ADJ_TEMPERATURE", iPoint, Node_AdjHeat->GetSolution(iPoint, 0)); - } - else { - if (nDim == 3) SetVolumeOutputValue("ADJ_TEMPERATURE", iPoint, Node_AdjFlow->GetSolution(iPoint, 4)); - else SetVolumeOutputValue("ADJ_TEMPERATURE", iPoint, Node_AdjFlow->GetSolution(iPoint, 3)); + } else { + if (nDim == 3) + SetVolumeOutputValue("ADJ_ENTHALPY", iPoint, Node_AdjFlow->GetSolution(iPoint, 4)); + else + SetVolumeOutputValue("ADJ_ENTHALPY", iPoint, Node_AdjFlow->GetSolution(iPoint, 3)); } // Radiation @@ -397,10 +423,15 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo SetVolumeOutputValue("RES_ADJ_VELOCITY-X", iPoint, Node_AdjFlow->GetSolution(iPoint, 1) - Node_AdjFlow->GetSolution_Old(iPoint, 1)); SetVolumeOutputValue("RES_ADJ_VELOCITY-Y", iPoint, Node_AdjFlow->GetSolution(iPoint, 2) - Node_AdjFlow->GetSolution_Old(iPoint, 2)); if (nDim == 3) { - SetVolumeOutputValue("RES_ADJ_VELOCITY-Z", iPoint, Node_AdjFlow->GetSolution(iPoint, 3) - Node_AdjFlow->GetSolution_Old(iPoint, 3)); - SetVolumeOutputValue("RES_ADJ_TEMPERATURE", iPoint, Node_AdjFlow->GetSolution(iPoint, 4) - Node_AdjFlow->GetSolution_Old(iPoint, 4)); + SetVolumeOutputValue("RES_ADJ_VELOCITY-Z", iPoint, + Node_AdjFlow->GetSolution(iPoint, 3) - Node_AdjFlow->GetSolution_Old(iPoint, 3)); + if (heat) + SetVolumeOutputValue("RES_ADJ_ENTHALPY", iPoint, + Node_AdjFlow->GetSolution(iPoint, 4) - Node_AdjFlow->GetSolution_Old(iPoint, 4)); } else { - SetVolumeOutputValue("RES_ADJ_TEMPERATURE", iPoint, Node_AdjFlow->GetSolution(iPoint, 3) - Node_AdjFlow->GetSolution_Old(iPoint, 3)); + if (heat) + SetVolumeOutputValue("RES_ADJ_ENTHALPY", iPoint, + Node_AdjFlow->GetSolution(iPoint, 3) - Node_AdjFlow->GetSolution_Old(iPoint, 3)); } if (config->AddRadiation()) { diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 761f4ab9a13d..9d408892cf6e 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -107,8 +107,10 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("RMS_VELOCITY-Y", "rms[V]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the velocity y-component.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Root-mean square residual of the velocity z-component. if (nDim == 3) AddHistoryOutput("RMS_VELOCITY-Z", "rms[W]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the velocity z-component.", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Maximum residual of the temperature. - if (heat || weakly_coupled_heat) AddHistoryOutput("RMS_TEMPERATURE", "rms[T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the temperature.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the temperature. + if (weakly_coupled_heat) AddHistoryOutput("RMS_TEMPERATURE", "rms[T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the temperature.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the enthalpy. + if (heat) AddHistoryOutput("RMS_ENTHALPY", "rms[h]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the enthalpy.", HistoryFieldType::RESIDUAL); AddHistoryOutputFields_ScalarRMS_RES(config); @@ -127,8 +129,12 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ if (nDim == 3) AddHistoryOutput("MAX_VELOCITY-Z", "max[W]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the velocity z-component.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the temperature. - if (heat || weakly_coupled_heat) + if (weakly_coupled_heat) AddHistoryOutput("MAX_TEMPERATURE", "max[T]", ScreenOutputFormat::FIXED, "MAX_RES", "Root-mean square residual of the temperature.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the enthalpy. + if (heat) { + AddHistoryOutput("MAX_ENTHALPY", "max[h]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the enthalpy.", HistoryFieldType::RESIDUAL); + } AddHistoryOutputFields_ScalarMAX_RES(config); /// END_GROUP @@ -144,8 +150,12 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ if (nDim == 3) AddHistoryOutput("BGS_VELOCITY-Z", "bgs[W]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the velocity z-component.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the temperature. - if (heat || weakly_coupled_heat) + if (weakly_coupled_heat) AddHistoryOutput("BGS_TEMPERATURE", "bgs[T]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the temperature.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the Enthalpy. + if (heat) + AddHistoryOutput("BGS_ENTHALPY", "bgs[h]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the enthalpy.", + HistoryFieldType::RESIDUAL); AddHistoryOutputFields_ScalarBGS_RES(config); @@ -232,10 +242,10 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv if (heat) { SetHeatCoefficients(config, flow_solver); SetHistoryOutputValue("AVG_TEMPERATURE", flow_solver->GetTotal_AvgTemperature()); - SetHistoryOutputValue("RMS_TEMPERATURE", log10(flow_solver->GetRes_RMS(nDim + 1))); - SetHistoryOutputValue("MAX_TEMPERATURE", log10(flow_solver->GetRes_Max(nDim + 1))); + SetHistoryOutputValue("RMS_ENTHALPY", log10(flow_solver->GetRes_RMS(nDim + 1))); + SetHistoryOutputValue("MAX_ENTHALPY", log10(flow_solver->GetRes_Max(nDim + 1))); if (multiZone) { - SetHistoryOutputValue("BGS_TEMPERATURE", log10(flow_solver->GetRes_BGS(nDim + 1))); + SetHistoryOutputValue("BGS_ENTHALPY", log10(flow_solver->GetRes_BGS(nDim + 1))); } } @@ -295,8 +305,8 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("VELOCITY-Y", "Velocity_y", "SOLUTION", "y-component of the velocity vector"); if (nDim == 3) AddVolumeOutput("VELOCITY-Z", "Velocity_z", "SOLUTION", "z-component of the velocity vector"); - if (heat || weakly_coupled_heat || flamelet) - AddVolumeOutput("TEMPERATURE", "Temperature","SOLUTION", "Temperature"); + if (weakly_coupled_heat) AddVolumeOutput("TEMPERATURE", "Temperature", "SOLUTION", "Temperature"); + if (heat) AddVolumeOutput("ENTHALPY", "Enthalpy", "SOLUTION", "Enthalpy"); SetVolumeOutputFieldsScalarSolution(config); @@ -320,6 +330,7 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("LAMINAR_VISCOSITY", "Laminar_Viscosity", "PRIMITIVE", "Laminar viscosity"); AddVolumeOutput("HEAT_CAPACITY", "Heat_Capacity", "PRIMITIVE", "Heat capacity"); AddVolumeOutput("THERMAL_CONDUCTIVITY", "Thermal_Conductivity", "PRIMITIVE", "Thermal conductivity"); + if (heat || flamelet) AddVolumeOutput("TEMPERATURE", "Temperature", "PRIMITIVE", "Temperature"); AddVolumeOutput("SKIN_FRICTION-X", "Skin_Friction_Coefficient_x", "PRIMITIVE", "x-component of the skin friction vector"); AddVolumeOutput("SKIN_FRICTION-Y", "Skin_Friction_Coefficient_y", "PRIMITIVE", "y-component of the skin friction vector"); @@ -343,9 +354,9 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_VELOCITY-Y", "Residual_Velocity_y", "RESIDUAL", "Residual of the y-velocity component"); if (nDim == 3) AddVolumeOutput("RES_VELOCITY-Z", "Residual_Velocity_z", "RESIDUAL", "Residual of the z-velocity component"); - if (config->GetEnergy_Equation()) - AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature"); - + if (config->GetEnergy_Equation()){ + AddVolumeOutput("RES_ENTHALPY", "Residual_Enthalpy", "RESIDUAL", "Residual of the enthalpy"); + } SetVolumeOutputFieldsScalarResidual(config); if (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE && config->GetKind_SlopeLimit_Flow() != LIMITER::VAN_ALBADA_EDGE) { @@ -354,8 +365,12 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("LIMITER_VELOCITY-Y", "Limiter_Velocity_y", "LIMITER", "Limiter value of the y-velocity"); if (nDim == 3) AddVolumeOutput("LIMITER_VELOCITY-Z", "Limiter_Velocity_z", "LIMITER", "Limiter value of the z-velocity"); - if (heat || weakly_coupled_heat || flamelet) + if (weakly_coupled_heat) + AddVolumeOutput("LIMITER_TEMPERATURE", "Limiter_Temperature", "LIMITER", "Limiter value of the temperature"); + if (heat) { AddVolumeOutput("LIMITER_TEMPERATURE", "Limiter_Temperature", "LIMITER", "Limiter value of the temperature"); + AddVolumeOutput("LIMITER_ENTHALPY", "Limiter_Enthalpy", "LIMITER", "Limiter value of the enthalpy"); + } } SetVolumeOutputFieldsScalarLimiter(config); @@ -399,7 +414,9 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve if (nDim == 3) SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetSolution(iPoint, 3)); - if (heat || flamelet) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(iPoint, nDim+1)); + if (heat) { + SetVolumeOutputValue("ENTHALPY", iPoint, Node_Flow->GetSolution(iPoint, nDim+1)); + } if (weakly_coupled_heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(iPoint, 0)); // Radiation solver @@ -423,6 +440,7 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("LAMINAR_VISCOSITY", iPoint, Node_Flow->GetLaminarViscosity(iPoint)); SetVolumeOutputValue("HEAT_CAPACITY", iPoint, Node_Flow->GetSpecificHeatCp(iPoint)); SetVolumeOutputValue("THERMAL_CONDUCTIVITY", iPoint, Node_Flow->GetThermalConductivity(iPoint)); + if (heat || flamelet) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetTemperature(iPoint)); } SetVolumeOutputValue("RES_PRESSURE", iPoint, solver[FLOW_SOL]->LinSysRes(iPoint, 0)); @@ -430,8 +448,9 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("RES_VELOCITY-Y", iPoint, solver[FLOW_SOL]->LinSysRes(iPoint, 2)); if (nDim == 3) SetVolumeOutputValue("RES_VELOCITY-Z", iPoint, solver[FLOW_SOL]->LinSysRes(iPoint, 3)); - if (config->GetEnergy_Equation()) - SetVolumeOutputValue("RES_TEMPERATURE", iPoint, solver[FLOW_SOL]->LinSysRes(iPoint, nDim+1)); + if (config->GetEnergy_Equation()) { + SetVolumeOutputValue("RES_ENTHALPY", iPoint, solver[FLOW_SOL]->LinSysRes(iPoint, nDim+1)); + } if (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE && config->GetKind_SlopeLimit_Flow() != LIMITER::VAN_ALBADA_EDGE) { SetVolumeOutputValue("LIMITER_PRESSURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 0)); @@ -439,8 +458,12 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("LIMITER_VELOCITY-Y", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 2)); if (nDim == 3) SetVolumeOutputValue("LIMITER_VELOCITY-Z", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, 3)); - if (heat || weakly_coupled_heat) + if (weakly_coupled_heat) + SetVolumeOutputValue("LIMITER_TEMPERATURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+1)); + if (heat){ SetVolumeOutputValue("LIMITER_TEMPERATURE", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+1)); + SetVolumeOutputValue("LIMITER_ENTHALPY", iPoint, Node_Flow->GetLimiter_Primitive(iPoint, nDim+3)); + } } // All turbulence and species outputs. diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index b355c0698afb..696a4c595475 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -241,7 +241,7 @@ void CFlowOutput::SetAnalyzeSurface(const CSolver* const*solver, const CGeometry sqrt(config->GetBulk_Modulus()/(flow_nodes->GetDensity(iPoint))); } Temperature = flow_nodes->GetTemperature(iPoint); - Enthalpy = flow_nodes->GetSpecificHeatCp(iPoint)*Temperature; + Enthalpy = flow_nodes->GetEnthalpy(iPoint); TotalTemperature = Temperature + 0.5*Velocity2/flow_nodes->GetSpecificHeatCp(iPoint); TotalPressure = Pressure + 0.5*Density*Velocity2; } diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 3df1ffbe3dd8..246da78c22b5 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -54,6 +54,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned bool time_stepping = config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING; bool adjoint = (config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint()); const bool centered = config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED; + const su2double* scalar_init = nullptr; /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); @@ -107,7 +108,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned /*--- Make sure to align the sizes with the constructor of CIncEulerVariable. ---*/ nVar = nDim + 2; - nPrimVar = nDim + 9; + nPrimVar = nDim + 10; /*--- Centered schemes only need gradients for viscous fluxes (T and v, but we need also to include P). ---*/ nPrimVarGrad = nDim + (centered ? 2 : 4); @@ -166,6 +167,9 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned Pressure_Inf = config->GetPressure_FreeStreamND(); Velocity_Inf = config->GetVelocity_FreeStreamND(); Temperature_Inf = config->GetTemperature_FreeStreamND(); + if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) scalar_init = config->GetSpecies_Init(); + GetFluidModel()->SetTDState_T(Temperature_Inf, scalar_init); + Enthalpy_Inf = GetFluidModel()->GetEnthalpy(); /*--- Initialize the secondary values for direct derivative approxiations ---*/ @@ -196,9 +200,9 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned /*--- Initialize the solution to the far-field state everywhere. ---*/ if (navier_stokes) { - nodes = new CIncNSVariable(Pressure_Inf, Velocity_Inf, Temperature_Inf, nPoint, nDim, nVar, config); + nodes = new CIncNSVariable(Pressure_Inf, Velocity_Inf, Enthalpy_Inf, nPoint, nDim, nVar, config); } else { - nodes = new CIncEulerVariable(Pressure_Inf, Velocity_Inf, Temperature_Inf, nPoint, nDim, nVar, config); + nodes = new CIncEulerVariable(Pressure_Inf, Velocity_Inf, Enthalpy_Inf, nPoint, nDim, nVar, config); } SetBaseClassPointerToNodes(); @@ -1229,6 +1233,7 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont const bool limiter = (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE); const bool van_albada = (config->GetKind_SlopeLimit_Flow() == LIMITER::VAN_ALBADA_EDGE); const bool bounded_scalar = config->GetBounded_Scalar(); + const bool multicomponent = (config->GetKind_FluidModel() == FLUID_MIXTURE); const su2double nkRelax = config->GetNewtonKrylovRelaxation(); const su2double kappa = config->GetMUSCL_Kappa_Flow(); @@ -1301,6 +1306,12 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont Primitive_i[iVar] = V_i[iVar]; Primitive_j[iVar] = V_j[iVar]; } + if(multicomponent){ + const su2double* scalar_i = solver_container[SPECIES_SOL]->GetNodes()->GetSolution(iPoint); + const su2double* scalar_j = solver_container[SPECIES_SOL]->GetNodes()->GetSolution(jPoint); + ComputeConsistentExtrapolation(GetFluidModel(), nDim, scalar_i, Primitive_i); + ComputeConsistentExtrapolation(GetFluidModel(), nDim, scalar_j, Primitive_j); + } /*--- Check for non-physical solutions after reconstruction. If found, use the cell-average value of the solution. This results in a locally @@ -1372,6 +1383,16 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont FinalizeResidualComputation(geometry, pausePreacc, counter_local, config); } +void CIncEulerSolver::ComputeConsistentExtrapolation(CFluidModel* fluidModel, unsigned short nDim, + const su2double* scalar, su2double* primitive) { + const CIncEulerVariable::CIndices prim_idx(nDim, 0); + const su2double enthalpy = primitive[prim_idx.Enthalpy()]; + fluidModel->SetTDState_h(enthalpy, scalar); + + primitive[prim_idx.Temperature()] = fluidModel->GetTemperature(); + primitive[prim_idx.Density()] = fluidModel->GetDensity(); +} + void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { @@ -1390,6 +1411,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont const bool energy = config->GetEnergy_Equation(); const bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE); const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); + const bool multicomponent = (config->GetKind_FluidModel() == FLUID_MIXTURE); AD::StartNoSharedReading(); @@ -1572,6 +1594,35 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont numerics->SetAuxVarGrad(nodes->GetAuxVarGradient(iPoint), nullptr); + if(multicomponent && energy){ + /*--- retrieve number of species that are solved and set maximum static array ---*/ + int n_species = config->GetnSpecies(); + static constexpr size_t MAXNVAR_SPECIES = 20UL; + /*--- Obtain fluid model for computing the enthalpy diffusion terms. ---*/ + CFluidModel* FluidModel = solver_container[FLOW_SOL]->GetFluidModel(); + /*--- retrieve species gradient needed for multicomponent. ---*/ + CMatrixView Species_Grad_i = solver_container[SPECIES_SOL]->GetNodes()->GetGradient(iPoint); + /*--- Set thermodynamic state. ---*/ + FluidModel->SetTDState_T(nodes->GetTemperature(iPoint),solver_container[SPECIES_SOL]->GetNodes()->GetSolution(iPoint)); + /*--- Get enthalpy diffusion terms and its gradients(for implicit). ---*/ + su2double EnthalpyDiffusion_i[MAXNVAR_SPECIES]{0.0}; + su2double GradEnthalpyDiffusion_i[MAXNVAR_SPECIES]{0.0}; + FluidModel->GetEnthalpyDiffusivity(EnthalpyDiffusion_i); + if (implicit) FluidModel->GetGradEnthalpyDiffusivity(GradEnthalpyDiffusion_i); + /*--- Compute Enthalpy diffusion flux and its jacobian (for implicit iterations) ---*/ + su2double flux_enthalpy_diffusion = 0.0; + su2double jac_flux_enthalpy_diffusion = 0.0; + for (int i_species = 0; i_species < n_species; i_species++) { + flux_enthalpy_diffusion += EnthalpyDiffusion_i[i_species]* Species_Grad_i[i_species][1]; + if (implicit) + jac_flux_enthalpy_diffusion += GradEnthalpyDiffusion_i[i_species] * Species_Grad_i[i_species][1]; + } + + /*--- Set heat flux and jacobian (for implicit) due to enthalpy diffusion ---*/ + + numerics->SetHeatFluxDiffusion(flux_enthalpy_diffusion); + if (implicit) numerics->SetJacHeatFluxDiffusion(jac_flux_enthalpy_diffusion); + } } /*--- Compute Source term Residual ---*/ @@ -1610,6 +1661,10 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont second_numerics->SetVolume(geometry->nodes->GetVolume(iPoint)); + /*--- Set Cp (for implicit) ---*/ + + if (implicit) second_numerics->SetSpecificHeat(nodes->GetSpecificHeatCp(iPoint), 0.0); + /*--- Compute the residual ---*/ auto residual = second_numerics->ComputeResidual(config); @@ -2016,7 +2071,7 @@ void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPo unsigned short iDim, jDim, iVar, jVar; - su2double BetaInc2, Density, dRhodT, Temperature, oneOverCp, Cp; + su2double BetaInc2, Density, dRhodh, Temperature, Cp, Enthalpy; su2double Velocity[MAXNDIM] = {0.0}; bool variable_density = (config->GetVariable_Density_Model()); @@ -2028,20 +2083,20 @@ void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPo Density = nodes->GetDensity(iPoint); BetaInc2 = nodes->GetBetaInc2(iPoint); Cp = nodes->GetSpecificHeatCp(iPoint); - oneOverCp = 1.0/Cp; Temperature = nodes->GetTemperature(iPoint); + Enthalpy = nodes->GetEnthalpy(iPoint); for (iDim = 0; iDim < nDim; iDim++) Velocity[iDim] = nodes->GetVelocity(iPoint,iDim); /*--- We need the derivative of the equation of state to build the preconditioning matrix. For now, the only option is the ideal gas - law, but in the future, dRhodT should be in the fluid model. ---*/ + law, but in the future, dRhodh should be in the fluid model. ---*/ if (variable_density) { - dRhodT = -Density/Temperature; + dRhodh = -Density / (Cp * Temperature); } else { - dRhodT = 0.0; + dRhodh = 0.0; } /*--- Calculating the inverse of the preconditioning matrix @@ -2056,8 +2111,11 @@ void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPo for (iDim = 0; iDim < nDim; iDim++) Preconditioner[iDim+1][0] = Velocity[iDim]/BetaInc2; - if (energy) Preconditioner[nDim+1][0] = Cp*Temperature/BetaInc2; - else Preconditioner[nDim+1][0] = 0.0; + if (energy) { + Preconditioner[nDim+1][0] = Enthalpy / BetaInc2; + } else { + Preconditioner[nDim+1][0] = 0.0; + } for (jDim = 0; jDim < nDim; jDim++) { Preconditioner[0][jDim+1] = 0.0; @@ -2068,50 +2126,56 @@ void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPo Preconditioner[nDim+1][jDim+1] = 0.0; } - Preconditioner[0][nDim+1] = dRhodT; - for (iDim = 0; iDim < nDim; iDim++) - Preconditioner[iDim+1][nDim+1] = Velocity[iDim]*dRhodT; + Preconditioner[0][nDim+1] = dRhodh; + for (iDim = 0; iDim < nDim; iDim++) Preconditioner[iDim+1][nDim+1] = Velocity[iDim] * dRhodh; - if (energy) Preconditioner[nDim+1][nDim+1] = Cp*(dRhodT*Temperature + Density); - else Preconditioner[nDim+1][nDim+1] = 1.0; + if (energy) { + Preconditioner[nDim+1][nDim+1] = dRhodh * Enthalpy + Density; + } else { + Preconditioner[nDim+1][nDim+1] = 1.0; + } for (iVar = 0; iVar < nVar; iVar ++ ) for (jVar = 0; jVar < nVar; jVar ++ ) Preconditioner[iVar][jVar] = delta*Preconditioner[iVar][jVar]; } else { - /*--- For explicit calculations, we move the residual to the right-hand side and pre-multiply by the preconditioner inverse. Therefore, we build inv(Precon) here and multiply by the residual later in the R-K and Euler Explicit time integration schemes. ---*/ - Preconditioner[0][0] = Temperature*BetaInc2*dRhodT/Density + BetaInc2; - for (iDim = 0; iDim < nDim; iDim ++) - Preconditioner[iDim+1][0] = -1.0*Velocity[iDim]/Density; - - if (energy) Preconditioner[nDim+1][0] = -1.0*Temperature/Density; - else Preconditioner[nDim+1][0] = 0.0; + + Preconditioner[0][0] = Enthalpy * BetaInc2 * dRhodh / Density + BetaInc2; + + for (iDim = 0; iDim < nDim; iDim++) Preconditioner[iDim + 1][0] = -1.0 * Velocity[iDim] / Density; + if (energy) { + Preconditioner[nDim+1][0] = -1.0 * Enthalpy / Density; + } else { + Preconditioner[nDim+1][0] = 0.0; + } for (jDim = 0; jDim < nDim; jDim++) { Preconditioner[0][jDim+1] = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - if (iDim == jDim) Preconditioner[iDim+1][jDim+1] = 1.0/Density; - else Preconditioner[iDim+1][jDim+1] = 0.0; + if (iDim == jDim) + Preconditioner[iDim+1][jDim+1] = 1.0 / Density; + else + Preconditioner[iDim+1][jDim+1] = 0.0; } Preconditioner[nDim+1][jDim+1] = 0.0; } - Preconditioner[0][nDim+1] = -1.0*BetaInc2*dRhodT*oneOverCp/Density; - for (iDim = 0; iDim < nDim; iDim ++) - Preconditioner[iDim+1][nDim+1] = 0.0; - - if (energy) Preconditioner[nDim+1][nDim+1] = oneOverCp/Density; - else Preconditioner[nDim+1][nDim+1] = 0.0; + Preconditioner[0][nDim+1] = -1.0 * BetaInc2 * dRhodh / Density; + for (iDim = 0; iDim < nDim; iDim++) Preconditioner[iDim+1][nDim+1] = 0.0; + if (energy) { + Preconditioner[nDim+1][nDim+1] = 1 / Density; + } else { + Preconditioner[nDim+1][nDim+1] = 0.0; + } } - } void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, @@ -2122,6 +2186,8 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain const bool implicit = config->GetKind_TimeIntScheme() == EULER_IMPLICIT; const bool viscous = config->GetViscous(); + const bool energy_multicomponent = config->GetKind_FluidModel() == FLUID_MIXTURE && config->GetEnergy_Equation(); + const bool species_model = config->GetKind_Species_Model() != SPECIES_MODEL::NONE; su2double Normal[MAXNDIM] = {0.0}; @@ -2166,6 +2232,13 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain V_infty[prim_idx.Temperature()] = GetTemperature_Inf(); + /*-- Enthalpy at far-field. ---*/ + const su2double* scalar_infty = nullptr; + if (species_model) scalar_infty = config->GetSpecies_Init(); + CFluidModel* auxFluidModel = solver_container[FLOW_SOL]->GetFluidModel(); + auxFluidModel->SetTDState_T(V_infty[prim_idx.Temperature()], scalar_infty); + V_infty[prim_idx.Enthalpy()] = auxFluidModel->GetEnthalpy(); + /*--- Store the density. ---*/ V_infty[prim_idx.Density()] = GetDensity_Inf(); @@ -2201,7 +2274,7 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain /*--- Viscous residual contribution ---*/ - if (!viscous) continue; + if (!viscous || energy_multicomponent) continue; /*--- Set transport properties at infinity. ---*/ @@ -2256,6 +2329,8 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool viscous = config->GetViscous(); + const bool energy_multicomponent = config->GetKind_FluidModel() == FLUID_MIXTURE && config->GetEnergy_Equation(); + const bool species_model = config->GetKind_Species_Model() != SPECIES_MODEL::NONE; string Marker_Tag = config->GetMarker_All_TagBound(val_marker); @@ -2419,6 +2494,13 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, V_inlet[prim_idx.Pressure()] = nodes->GetPressure(iPoint); } + /*-- Enthalpy is needed for energy equation. ---*/ + const su2double* scalar_inlet = nullptr; + if (species_model) scalar_inlet = config->GetInlet_SpeciesVal(config->GetMarker_All_TagBound(val_marker)); + CFluidModel* auxFluidModel = solver_container[FLOW_SOL]->GetFluidModel(); + auxFluidModel->SetTDState_T(V_inlet[prim_idx.Temperature()], scalar_inlet); + V_inlet[prim_idx.Enthalpy()] = auxFluidModel->GetEnthalpy(); + /*--- Access density at the node. This is either constant by construction, or will be set fixed implicitly by the temperature and equation of state. ---*/ @@ -2456,7 +2538,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Viscous contribution, commented out because serious convergence problems ---*/ - if (!viscous) continue; + if (!viscous || energy_multicomponent) continue; /*--- Set transport properties at the inlet ---*/ @@ -2508,6 +2590,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool viscous = config->GetViscous(); + const bool energy_multicomponent = config->GetKind_FluidModel() == FLUID_MIXTURE && config->GetEnergy_Equation(); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); su2double Normal[MAXNDIM] = {0.0}; @@ -2634,6 +2717,9 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, V_outlet[prim_idx.CpTotal()] = nodes->GetSpecificHeatCp(iPoint); + /*-- Neumann condition for Enthalpy in energy equation. ---*/ + V_outlet[prim_idx.Enthalpy()] = nodes->GetEnthalpy(iPoint); + /*--- Set various quantities in the solver class ---*/ conv_numerics->SetPrimitive(V_domain, V_outlet); @@ -2658,7 +2744,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, /*--- Viscous contribution, commented out because serious convergence problems ---*/ - if (!viscous) continue; + if (!viscous || energy_multicomponent) continue; /*--- Set transport properties at the outlet. ---*/ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 30f0efd46d98..28747c7e1d71 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -275,10 +275,88 @@ void CIncNSSolver::Compute_Streamwise_Periodic_Recovered_Values(CConfig *config, void CIncNSSolver::Viscous_Residual(unsigned long iEdge, CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) { + const bool energy_multicomponent = config->GetKind_FluidModel() == FLUID_MIXTURE && config->GetEnergy_Equation(); + + /*--- Contribution to heat flux due to enthalpy diffusion for multicomponent and reacting flows ---*/ + if (energy_multicomponent) { + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const int n_species = config->GetnSpecies(); + Compute_Enthalpy_Diffusion(iEdge, geometry, solver_container, numerics, n_species, implicit); + } Viscous_Residual_impl(iEdge, geometry, solver_container, numerics, config); } +void CIncNSSolver::Compute_Enthalpy_Diffusion(unsigned long iEdge, CGeometry* geometry, CSolver** solver_container, + CNumerics* numerics, const int n_species, const bool implicit) { + + CVariable* speciesNodes = solver_container[SPECIES_SOL]->GetNodes(); + /*--- Points in edge ---*/ + + auto iPoint = geometry->edges->GetNode(iEdge, 0); + auto jPoint = geometry->edges->GetNode(iEdge, 1); + + /*--- Points coordinates, and normal vector ---*/ + + const su2double* Normal = geometry->edges->GetNormal(iEdge); + const su2double* Coord_i = geometry->nodes->GetCoord(iPoint); + const su2double* Coord_j = geometry->nodes->GetCoord(jPoint); + + /*--- Obtain fluid model for computing the enthalpy diffusion terms. ---*/ + + CFluidModel* FluidModel = solver_container[FLOW_SOL]->GetFluidModel(); + + /*--- Helper function that retrieves enthalpy diffusion terms. ---*/ + auto GetEnthalpyDiffusionTerms = [&](unsigned long Point, const su2double* Species, su2double* EnthalpyDiffusion, + su2double* GradEnthalpyDiffusion) { + FluidModel->SetTDState_T(nodes->GetPrimitive(Point)[prim_idx.Temperature()], Species); + FluidModel->SetEddyViscosity(nodes->GetPrimitive(Point)[prim_idx.EddyViscosity()]); + FluidModel->GetEnthalpyDiffusivity(EnthalpyDiffusion); + if (implicit) FluidModel->GetGradEnthalpyDiffusivity(GradEnthalpyDiffusion); + }; + + /*--- set maximum static array ---*/ + + static constexpr size_t MAXNVAR_SPECIES = 20UL; + + /*--- Species variables, and its gradients ---*/ + const su2double* Species_i = speciesNodes->GetSolution(iPoint); + const su2double* Species_j = speciesNodes->GetSolution(jPoint); + CMatrixView Species_Grad_i = speciesNodes->GetGradient(iPoint); + CMatrixView Species_Grad_j = speciesNodes->GetGradient(jPoint); + + /*--- Compute Projected gradient for species variables ---*/ + su2double ProjGradScalarVarNoCorr[MAXNVAR_SPECIES]{0.0}; + su2double Proj_Mean_GradScalarVar[MAXNVAR_SPECIES]{0.0}; + numerics->ComputeProjectedGradient(nDim, n_species, Normal, Coord_i, Coord_j, Species_Grad_i, Species_Grad_j, true, + Species_i, Species_j, ProjGradScalarVarNoCorr, Proj_Mean_GradScalarVar); + + /*--- Get enthalpy diffusion terms and its gradient(for implicit) for each species at iPoint and jPoint. ---*/ + + su2double EnthalpyDiffusion_i[MAXNVAR_SPECIES]{0.0}; + su2double GradEnthalpyDiffusion_i[MAXNVAR_SPECIES]{0.0}; + su2double EnthalpyDiffusion_j[MAXNVAR_SPECIES]{0.0}; + su2double GradEnthalpyDiffusion_j[MAXNVAR_SPECIES]{0.0}; + GetEnthalpyDiffusionTerms(iPoint, Species_i, EnthalpyDiffusion_i, GradEnthalpyDiffusion_i); + GetEnthalpyDiffusionTerms(jPoint, Species_j, EnthalpyDiffusion_j, GradEnthalpyDiffusion_j); + + /*--- Compute Enthalpy diffusion flux and its jacobian (for implicit iterations) ---*/ + su2double flux_enthalpy_diffusion = 0.0; + su2double jac_flux_enthalpy_diffusion = 0.0; + for (int i_species = 0; i_species < n_species; i_species++) { + flux_enthalpy_diffusion += + 0.5 * (EnthalpyDiffusion_i[i_species] + EnthalpyDiffusion_j[i_species]) * Proj_Mean_GradScalarVar[i_species]; + if (implicit) + jac_flux_enthalpy_diffusion += 0.5 * (GradEnthalpyDiffusion_i[i_species] + GradEnthalpyDiffusion_j[i_species]) * + Proj_Mean_GradScalarVar[i_species]; + } + + /*--- Set heat flux and jacobian (for implicit) due to enthalpy diffusion ---*/ + + numerics->SetHeatFluxDiffusion(flux_enthalpy_diffusion); + if (implicit) numerics->SetJacHeatFluxDiffusion(jac_flux_enthalpy_diffusion); +} + unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, const CConfig *config) { unsigned long iPoint, nonPhysicalPoints = 0; @@ -459,7 +537,8 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con LinSysRes(iPoint, nDim+1) -= Wall_HeatFlux*Area; if (implicit) { - Jacobian.AddVal2Diag(iPoint, nDim+1, Transfer_Coefficient*Area); + const su2double Cp = nodes->GetSpecificHeatCp(iPoint); + Jacobian.AddVal2Diag(iPoint, nDim+1, Transfer_Coefficient*Area/Cp); } break; @@ -482,7 +561,6 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con const su2double dTdn = -(nodes->GetTemperature(Point_Normal) - Twall)/dist_ij; /*--- Get thermal conductivity ---*/ - const su2double thermal_conductivity = nodes->GetThermalConductivity(iPoint); /*--- Apply a weak boundary condition for the energy equation. @@ -493,7 +571,8 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Jacobian contribution for temperature equation. ---*/ if (implicit) { - Jacobian.AddVal2Diag(iPoint, nDim+1, thermal_conductivity * Area / dist_ij); + const su2double Cp = nodes->GetSpecificHeatCp(iPoint); + Jacobian.AddVal2Diag(iPoint, nDim + 1, thermal_conductivity * Area / (dist_ij * Cp)); } break; } // switch @@ -524,6 +603,7 @@ void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **sol const su2double Temperature_Ref = config->GetTemperature_Ref(); const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool energy = config->GetEnergy_Equation(); + const su2double* scalars = nullptr; /*--- Identify the boundary ---*/ @@ -609,7 +689,17 @@ void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **sol /*--- Strong imposition of the temperature on the fluid zone. ---*/ LinSysRes(iPoint, nDim+1) = 0.0; - nodes->SetSolution_Old(iPoint, nDim+1, Twall); + + /*--- Retrieve scalars at wall node. ---*/ + if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE && solver_container[SPECIES_SOL] != nullptr) { + scalars = solver_container[SPECIES_SOL]->GetNodes()->GetSolution(iPoint); + } + /*--- Retrieve fluid model. ---*/ + CFluidModel* fluid_model_local = solver_container[FLOW_SOL]->GetFluidModel(); + /*--- Set thermodynamic state given wall temperature and species composition. ---*/ + fluid_model_local->SetTDState_T(Twall, scalars); + /*--- Set enthalpy obtained from fluid model. ---*/ + nodes->SetSolution_Old(iPoint, nDim + 1, fluid_model_local->GetEnthalpy()); nodes->SetEnergy_ResTruncError_Zero(iPoint); } END_SU2_OMP_FOR diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index 2bd124dadbbe..881de86562e4 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -28,9 +28,9 @@ #include "../../include/variables/CIncEulerVariable.hpp" #include "../../include/fluid/CFluidModel.hpp" -CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *velocity, su2double temperature, +CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *velocity, su2double enthalpy, unsigned long npoint, unsigned long ndim, unsigned long nvar, const CConfig *config) - : CFlowVariable(npoint, ndim, nvar, ndim + 9, + : CFlowVariable(npoint, ndim, nvar, ndim + 10, ndim + (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED ? 2 : 4), config), indices(ndim, 0) { @@ -42,7 +42,7 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci /*--- Solution initialization ---*/ - su2double val_solution[5] = {pressure, velocity[0], velocity[1], temperature, temperature}; + su2double val_solution[5] = {pressure, velocity[0], velocity[1], enthalpy, enthalpy}; if(nDim==3) val_solution[3] = velocity[2]; for(unsigned long iPoint=0; iPointSetTDState_h(Enthalpy); + su2double Temperature = FluidModel->GetTemperature(); const auto check_temp = SetTemperature(iPoint, Temperature, TemperatureLimits); /*--- Use the fluid model to compute the new value of density. Note that the thermodynamic pressure is constant and decoupled from the dynamic pressure being iterated. ---*/ - /*--- Use the fluid model to compute the new value of density. ---*/ - - FluidModel->SetTDState_T(Temperature); - /*--- Set the value of the density ---*/ const auto check_dens = SetDensity(iPoint, FluidModel->GetDensity()); @@ -103,9 +101,10 @@ bool CIncEulerVariable::SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel /*--- Recompute the primitive variables ---*/ - Temperature = Solution(iPoint, nDim+1); + Enthalpy = Solution(iPoint, nDim+1); + FluidModel->SetTDState_h(Enthalpy); + Temperature = FluidModel->GetTemperature(); SetTemperature(iPoint, Temperature, TemperatureLimits); - FluidModel->SetTDState_T(Temperature); SetDensity(iPoint, FluidModel->GetDensity()); /*--- Flag this point as non-physical. ---*/ @@ -118,10 +117,11 @@ bool CIncEulerVariable::SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel SetVelocity(iPoint); - /*--- Set specific heats (only necessary for consistency with preconditioning). ---*/ + /*--- Set enthalpy and specific heats (only necessary for consistency with preconditioning). ---*/ SetSpecificHeatCp(iPoint, FluidModel->GetCp()); SetSpecificHeatCv(iPoint, FluidModel->GetCv()); + SetEnthalpy(iPoint, FluidModel->GetEnthalpy()); return physical; diff --git a/SU2_CFD/src/variables/CIncNSVariable.cpp b/SU2_CFD/src/variables/CIncNSVariable.cpp index b98d0efaea9a..9f13d3a1212d 100644 --- a/SU2_CFD/src/variables/CIncNSVariable.cpp +++ b/SU2_CFD/src/variables/CIncNSVariable.cpp @@ -28,9 +28,10 @@ #include "../../include/variables/CIncNSVariable.hpp" #include "../../include/fluid/CFluidModel.hpp" -CIncNSVariable::CIncNSVariable(su2double pressure, const su2double *velocity, su2double temperature, +CIncNSVariable::CIncNSVariable(su2double pressure, const su2double *velocity, su2double enthalpy, unsigned long npoint, unsigned long ndim, unsigned long nvar, const CConfig *config) : - CIncEulerVariable(pressure, velocity, temperature, npoint, ndim, nvar, config) { + CIncEulerVariable(pressure, velocity, enthalpy, npoint, ndim, nvar, config), + Energy(config->GetEnergy_Equation()) { Vorticity.resize(nPoint,3); StrainMag.resize(nPoint); @@ -46,35 +47,34 @@ CIncNSVariable::CIncNSVariable(su2double pressure, const su2double *velocity, su AuxVar.resize(nPoint,nAuxVar) = su2double(0.0); Grad_AuxVar.resize(nPoint,nAuxVar,nDim); } + if(!Energy) TemperatureInc = config->GetInc_Temperature_Init(); } bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2double turb_ke, CFluidModel *FluidModel, const su2double *scalar) { bool physical = true; + su2double Temperature; + su2double Enthalpy; /*--- Set the value of the pressure ---*/ SetPressure(iPoint); - /*--- Set the value of the temperature directly ---*/ - - su2double Temperature = Solution(iPoint, indices.Temperature()); + if (Energy) { + Enthalpy = Solution(iPoint, nDim + 1); + FluidModel->SetTDState_h(Enthalpy, scalar); + Temperature = FluidModel->GetTemperature(); + } else { + /*--- When energy equation is switch off, a constant temperature is imposed, and enthalpy is recomputed based on + * this temperature. As in the fluid flamelet model, the temperature is retrieved from a look-up table, then the + * temperature is obtained directly from the fluidmodel. For the other fluid models, GetTemperature provides the + * same value as TemperatureInc ---*/ + FluidModel->SetTDState_T(TemperatureInc, scalar); + Enthalpy = Solution(iPoint, nDim + 1) = FluidModel->GetEnthalpy(); + Temperature = FluidModel->GetTemperature(); + } auto check_temp = SetTemperature(iPoint, Temperature, TemperatureLimits); - /*--- Use the fluid model to compute the new value of density. - Note that the thermodynamic pressure is constant and decoupled - from the dynamic pressure being iterated. ---*/ - - /*--- Use the fluid model to compute the new value of density. ---*/ - - FluidModel->SetTDState_T(Temperature, scalar); - - /*--- for FLAMELET: copy the LUT temperature into the solution ---*/ - Solution(iPoint,nDim+1) = FluidModel->GetTemperature(); - /*--- for FLAMELET: update the local temperature using LUT variables ---*/ - Temperature = Solution(iPoint,indices.Temperature()); - check_temp = SetTemperature(iPoint, Temperature, TemperatureLimits); - /*--- Set the value of the density ---*/ const auto check_dens = SetDensity(iPoint, FluidModel->GetDensity()); @@ -90,9 +90,10 @@ bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2do /*--- Recompute the primitive variables ---*/ - Temperature = Solution(iPoint, indices.Temperature()); - SetTemperature(iPoint, Temperature, TemperatureLimits); - FluidModel->SetTDState_T(Temperature, scalar); + Enthalpy = Solution(iPoint, nDim + 1); + FluidModel->SetTDState_h(Enthalpy, scalar); + SetTemperature(iPoint, FluidModel->GetTemperature(), TemperatureLimits); + SetDensity(iPoint, FluidModel->GetDensity()); /*--- Flag this point as non-physical. ---*/ @@ -122,6 +123,7 @@ bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2do SetSpecificHeatCp(iPoint, FluidModel->GetCp()); SetSpecificHeatCv(iPoint, FluidModel->GetCv()); + SetEnthalpy(iPoint, FluidModel->GetEnthalpy()); return physical; diff --git a/SU2_PY/SU2/io/historyMap.py b/SU2_PY/SU2/io/historyMap.py index a477478359c0..93a49a2ce0f5 100644 --- a/SU2_PY/SU2/io/historyMap.py +++ b/SU2_PY/SU2/io/historyMap.py @@ -148,6 +148,12 @@ "HEADER": "bgs[A_T]", "TYPE": "RESIDUAL", }, + "BGS_ADJ_ENTHALPY": { + "DESCRIPTION": "BGS residual of the adjoint " "enthalpy.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_h]", + "TYPE": "RESIDUAL", + }, "BGS_ADJ_TKE": { "DESCRIPTION": "BGS residual of the adjoint kinetic energy.", "GROUP": "BGS_RES", @@ -244,6 +250,12 @@ "HEADER": "bgs[T]", "TYPE": "RESIDUAL", }, + "BGS_ENTHALPY": { + "DESCRIPTION": "Block-Gauss-Seidel residual of the " "enthalpy", + "GROUP": "BGS_RES", + "HEADER": "bgs[h]", + "TYPE": "RESIDUAL", + }, "BGS_TKE": { "DESCRIPTION": "BGS residual of kinetic energy (SST model).", "GROUP": "BGS_RES", @@ -804,6 +816,12 @@ "HEADER": "max[A_T]", "TYPE": "RESIDUAL", }, + "MAX_ADJ_ENTHALPY": { + "DESCRIPTION": "Maximum residual of the enthalpy.", + "GROUP": "MAX_RES", + "HEADER": "max[A_h]", + "TYPE": "RESIDUAL", + }, "MAX_ADJ_TKE": { "DESCRIPTION": "Maximum residual of the adjoint kinetic " "energy.", "GROUP": "MAX_RES", @@ -894,6 +912,12 @@ "HEADER": "max[T]", "TYPE": "RESIDUAL", }, + "MAX_ENTHALPY": { + "DESCRIPTION": "Maximum residual of the enthalpy", + "GROUP": "MAX_RES", + "HEADER": "max[h]", + "TYPE": "RESIDUAL", + }, "MAX_TKE": { "DESCRIPTION": "Maximum residual of kinetic energy (SST model).", "GROUP": "MAX_RES", @@ -1043,6 +1067,12 @@ "HEADER": "rms[A_T]", "TYPE": "RESIDUAL", }, + "RMS_ADJ_ENTHALPY": { + "DESCRIPTION": "Root mean square residual of the " "adjoint enthalpy.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_h]", + "TYPE": "RESIDUAL", + }, "RMS_ADJ_TKE": { "DESCRIPTION": "Root-mean square residual of the adjoint " "kinetic energy.", "GROUP": "RMS_RES", @@ -1154,6 +1184,12 @@ "HEADER": "rms[T]", "TYPE": "RESIDUAL", }, + "RMS_ENTHALPY": { + "DESCRIPTION": "Root mean square residual of the " "enthalpy", + "GROUP": "RMS_RES", + "HEADER": "rms[h]", + "TYPE": "RESIDUAL", + }, "RMS_TKE": { "DESCRIPTION": "Root-mean square residual of kinetic energy (SST " "model).", "GROUP": "RMS_RES", diff --git a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/chtMaster.cfg b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/chtMaster.cfg index 6f3f5c486da0..b41f4517df01 100644 --- a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/chtMaster.cfg +++ b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/chtMaster.cfg @@ -30,9 +30,9 @@ ITER_AVERAGE_OBJ= 54 % ------------------------- INPUT/OUTPUT FILE INFORMATION --------------------------% % MESH_FILENAME= MeshCHT.su2 -SCREEN_OUTPUT= (TIME_ITER, OUTER_ITER, BGS_ADJ_PRESSURE[0], BGS_ADJ_VELOCITY-X[0], BGS_ADJ_VELOCITY-Y[0], BGS_ADJ_TEMPERATURE[0], BGS_ADJ_TEMPERATURE[1], SENS_TEMP[0], SENS_GEO[0], SENS_GEO[1] ) +SCREEN_OUTPUT= (TIME_ITER, OUTER_ITER, BGS_ADJ_PRESSURE[0], BGS_ADJ_VELOCITY-X[0], BGS_ADJ_VELOCITY-Y[0], BGS_ADJ_ENTHALPY[0], BGS_ADJ_TEMPERATURE[1], SENS_TEMP[0], SENS_GEO[0], SENS_GEO[1] ) % Suitable output for primal simulations -%SCREEN_OUTPUT= (TIME_ITER, OUTER_ITER, WALL_TIME, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], DRAG[0], AVG_TEMPERATURE[1] ) +%SCREEN_OUTPUT= (TIME_ITER, OUTER_ITER, WALL_TIME, BGS_PRESSURE[0], BGS_ENTHALPY[0], BGS_TEMPERATURE[1], DRAG[0], AVG_TEMPERATURE[1] ) SCREEN_WRT_FREQ_OUTER= 50 HISTORY_OUTPUT= ( ITER, BGS_RES[0], RMS_RES[0], BGS_RES[1], RMS_RES[1],\ FLOW_COEFF[0], HEAT[0], AERO_COEFF[0], HEAT[1],\ diff --git a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg index 8c441c6b40c0..039b53f63659 100644 --- a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg +++ b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg @@ -120,7 +120,7 @@ GRAD_OBJFUNC_FILENAME= of_grad SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint OUTPUT_WRT_FREQ= 250 -SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_PRESSURE, RMS_ADJ_TEMPERATURE, SENS_PRESS, SENS_AOA) +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_PRESSURE, RMS_ADJ_ENTHALPY, SENS_PRESS, SENS_AOA) % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index c7ad4c989645..4682755364ab 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -383,8 +383,8 @@ def main(): inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" inc_poly_cylinder.test_iter = 20 - inc_poly_cylinder.test_vals = [-7.827942, -2.061513, 0.029525, 1.953498, -174.780000] - inc_poly_cylinder.test_vals_aarch64 = [-7.827942, -2.061513, 0.029525, 1.953498, -174.780000] + inc_poly_cylinder.test_vals = [-8.241953, -2.424330, 0.027284, 1.909617, -173.010000] + inc_poly_cylinder.test_vals_aarch64 = [-8.241953, -2.424330, 0.027284, 1.909617, -173.010000] test_list.append(inc_poly_cylinder) # X-coarse laminar bend as a mixed element CGNS test @@ -420,7 +420,7 @@ def main(): inc_weakly_coupled.cfg_dir = "disc_adj_heat" inc_weakly_coupled.cfg_file = "primal.cfg" inc_weakly_coupled.test_iter = 10 - inc_weakly_coupled.test_vals = [-18.095922, -16.331787, -16.514014, -9.756795, -18.203865, -14.053738, 5.550800] + inc_weakly_coupled.test_vals = [-18.203897, -16.304273, -16.482683, -15.007166, -17.858118, -14.025087, 5.609100] test_list.append(inc_weakly_coupled) ###################################### @@ -665,8 +665,8 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [19.000000, -1.799803, -2.128200] - slinc_steady.test_vals_aarch64 = [19.000000, -1.799803, -2.128199] + slinc_steady.test_vals = [19.000000, -1.048446, -1.324274] + slinc_steady.test_vals_aarch64 = [19.000000, -1.048446, -1.324274] slinc_steady.multizone = True test_list.append(slinc_steady) diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index aaf75e035c08..e1ba90d6a1d0 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -111,8 +111,8 @@ def main(): discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 - discadj_incomp_cylinder.test_vals = [20.000000, -2.746353, -2.934777, 0.000000] - discadj_incomp_cylinder.test_vals_aarch64 = [20.000000, -2.731541, -2.890897, 0.000000] + discadj_incomp_cylinder.test_vals = [20.000000, -5.098033, -3.842740, 0.000000] + discadj_incomp_cylinder.test_vals_aarch64 = [20.000000, -5.098033, -3.842740, 0.000000] discadj_incomp_cylinder.tol_aarch64 = 2e-1 test_list.append(discadj_incomp_cylinder) diff --git a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg index 912fcb82ebe3..47474c4a0a74 100644 --- a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg +++ b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg @@ -114,7 +114,7 @@ GRAD_OBJFUNC_FILENAME= of_grad SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint OUTPUT_WRT_FREQ= 100 -SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, LIFT, DRAG) +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_ENTHALPY, LIFT, DRAG) % ----------------------- GEOMETRY EVALUATION PARAMETERS ----------------------% GEO_BOUNDS= ( 0.499, 0.501) diff --git a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg index a9454983bce0..e5dbb6b33d82 100644 --- a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg +++ b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg @@ -118,4 +118,4 @@ GRAD_OBJFUNC_FILENAME= of_grad SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint OUTPUT_WRT_FREQ= 250 -SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, LIFT, DRAG, TOTAL_HEATFLUX) +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_ENTHALPY, LIFT, DRAG, TOTAL_HEATFLUX) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg index 7d40427e2382..456da5af5886 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg @@ -113,7 +113,7 @@ CONV_STARTITER= 100000000 MESH_FILENAME= fluid.su2 % % SURFACE_STATIC_TEMPERATURE had to be removed from SCREEN_OUTPUT for the regression tests -SCREEN_OUTPUT= ( INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_TEMPERATURE, TOTAL_HEATFLUX) +SCREEN_OUTPUT= ( INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_ENTHALPY, TOTAL_HEATFLUX) SCREEN_WRT_FREQ_INNER= 1 % HISTORY_OUTPUT= ( ITER, RMS_RES, STREAMWISE_PERIODIC, FLOW_COEFF, LINSOL, HEAT ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg index 44c88e2dc6bb..1da45e0d05c8 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg @@ -20,7 +20,7 @@ MARKER_CHT_INTERFACE= ( fluid_pin1_interface, solid_pin1_interface, fluid_pin2_i CONV_RESIDUAL_MINVAL= -26 % OUTER_ITER= 3000 -SCREEN_OUTPUT= (OUTER_ITER, BGS_ADJ_PRESSURE[0], BGS_ADJ_TEMPERATURE[0], BGS_ADJ_TEMPERATURE[1]) +SCREEN_OUTPUT= (OUTER_ITER, BGS_ADJ_PRESSURE[0], BGS_ADJ_ENTHALPY[0], BGS_ADJ_TEMPERATURE[1]) SCREEN_WRT_FREQ_OUTER= 100 % HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1] ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg index 66dff17144aa..f00e49f8eb5d 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg @@ -23,7 +23,7 @@ CONV_RESIDUAL_MINVAL= -26 % FOR GADIENT VALIDATION USE OUTER_ITER= 3000! OUTER_ITER= 101 % -SCREEN_OUTPUT= ( WALL_TIME, OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) +SCREEN_OUTPUT= ( WALL_TIME, OUTER_ITER, BGS_PRESSURE[0], BGS_ENTHALPY[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1] ) SCREEN_WRT_FREQ_OUTER= 100 % HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1], STREAMWISE_PERIODIC[0], FLOW_COEFF[0], AERO_COEFF[0], HEAT[1] ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg index 0ec6bbadb332..229ca813cb04 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg @@ -21,7 +21,7 @@ CONV_RESIDUAL_MINVAL= -26 % OUTER_ITER= 4000 % -SCREEN_OUTPUT= ( OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1], SURFACE_MASSFLOW[0] ) +SCREEN_OUTPUT= ( OUTER_ITER, BGS_PRESSURE[0], BGS_ENTHALPY[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1], SURFACE_MASSFLOW[0] ) SCREEN_WRT_FREQ_OUTER= 100 % HISTORY_OUTPUT= ( ITER, BGS_RES[0], BGS_RES[1], RMS_RES[0], RMS_RES[1], STREAMWISE_PERIODIC[0], FLOW_COEFF[0], FLOW_COEFF_SURF[0], HEAT[1], LINSOL[0], LINSOL[1], HEAT[0] ) diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index d6673941ba48..2d925e77a8cd 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_NORMALVEL[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "SIDEFORCE[0]" , "SURFACE_MACH[0]", "SURFACE_MASSFLOW[0]", "SURFACE_MOM_DISTORTION[0]", "SURFACE_PRESSURE_DROP[0]", "SURFACE_SECONDARY[0]", "SURFACE_SECOND_OVER_UNIFORM[0]", "SURFACE_STATIC_PRESSURE[0]", "SURFACE_STATIC_TEMPERATURE[0]", "SURFACE_TOTAL_PRESSURE[0]", "SURFACE_TOTAL_TEMPERATURE[0]", "SURFACE_UNIFORMITY[0]", "AVG_TEMPERATURE[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , 0.0 , -3.330699999961374e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 2.2200000003768e-08, 0.0 , 0.0 , 0.009999995276288587, 0.04000000330961484 , -9.999999406318238 , -20.000004496978363 , -49.999999873762135 , -19.99999312829459 , -0.09999998606957661 , -199.99999949504854, -369.9999979289714, 1e-08 +0 , 0.0 , 0.0 , 3.3307000000906214e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -9.999996564147295 , -10.000007932831068 , 0.0 , -80.0000009348878 , -360.00000136482413, 1e-08 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg index 86c596886b26..8083f0574dfd 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg @@ -105,7 +105,7 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -CONV_FIELD= RMS_TEMPERATURE +CONV_FIELD= RMS_ENTHALPY CONV_RESIDUAL_MINVAL= -18 CONV_STARTITER= 100 % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg index f9626ad040e6..b8b591c13dc0 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg @@ -21,7 +21,7 @@ MARKER_CHT_INTERFACE= (fluid_bottom_interface, solid_bottom_interface, fluid_pin OUTER_ITER = 31 % CONV_RESIDUAL_MINVAL= -26 -SCREEN_OUTPUT= (OUTER_ITER, BGS_PRESSURE[0], BGS_TEMPERATURE[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1], TOTAL_HEATFLUX[0] ) +SCREEN_OUTPUT= (OUTER_ITER, BGS_PRESSURE[0], BGS_ENTHALPY[0], BGS_TEMPERATURE[1], STREAMWISE_MASSFLOW[0], STREAMWISE_DP[0], AVG_TEMPERATURE[1], TOTAL_HEATFLUX[0] ) SCREEN_WRT_FREQ_OUTER= 10 % HISTORY_OUTPUT= ( ITER, RMS_RES[0], RMS_RES[1], STREAMWISE_PERIODIC[0], FLOW_COEFF[0], HEAT[1] ) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index c96bc56ac810..c5a3a055ad5a 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -47,7 +47,7 @@ def main(): cfd_flamelet_ch4.cfg_dir = "flamelet/01_laminar_premixed_ch4_flame_cfd" cfd_flamelet_ch4.cfg_file = "lam_prem_ch4_cfd.cfg" cfd_flamelet_ch4.test_iter = 10 - cfd_flamelet_ch4.test_vals = [-14.297190, -12.593356, -14.249342, -6.069757, -14.816955, -17.057821] + cfd_flamelet_ch4.test_vals = [-11.167959, -10.484323, -12.764338, -5.876637, -13.407242, -17.032153] cfd_flamelet_ch4.new_output = True test_list.append(cfd_flamelet_ch4) @@ -56,7 +56,7 @@ def main(): cfd_flamelet_ch4_axi.cfg_dir = "flamelet/05_laminar_premixed_ch4_flame_cfd_axi" cfd_flamelet_ch4_axi.cfg_file = "lam_prem_ch4_cfd_axi.cfg" cfd_flamelet_ch4_axi.test_iter = 10 - cfd_flamelet_ch4_axi.test_vals = [-10.935482, -11.477701, -11.302709, -12.734435, -6.110542] + cfd_flamelet_ch4_axi.test_vals = [-10.083640, -11.327840, -10.714798, -12.750041, -6.112100] cfd_flamelet_ch4_axi.new_output = True test_list.append(cfd_flamelet_ch4_axi) @@ -65,7 +65,7 @@ def main(): cfd_flamelet_ch4_partial_premix.cfg_dir = "flamelet/06_laminar_partial_premixed_ch4_flame_cfd" cfd_flamelet_ch4_partial_premix.cfg_file = "lam_partial_prem_ch4_cfd.cfg" cfd_flamelet_ch4_partial_premix.test_iter = 10 - cfd_flamelet_ch4_partial_premix.test_vals = [-9.645814, -11.304194, -3.675580, -13.158500, -11.087904] + cfd_flamelet_ch4_partial_premix.test_vals = [-8.734770, -11.306471, -3.675618, -12.808760, -11.088026] cfd_flamelet_ch4_partial_premix.new_output = True test_list.append(cfd_flamelet_ch4_partial_premix) @@ -74,7 +74,7 @@ def main(): cfd_flamelet_h2.cfg_dir = "flamelet/07_laminar_premixed_h2_flame_cfd" cfd_flamelet_h2.cfg_file = "laminar_premixed_h2_flame_cfd.cfg" cfd_flamelet_h2.test_iter = 5 - cfd_flamelet_h2.test_vals = [-10.006096, -9.844001, -3.290043, -11.338465] + cfd_flamelet_h2.test_vals = [-9.984960, -9.843830, -3.289852, -11.338450] cfd_flamelet_h2.new_output = True test_list.append(cfd_flamelet_h2) @@ -611,7 +611,7 @@ def main(): inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" inc_poly_cylinder.test_iter = 20 - inc_poly_cylinder.test_vals = [-7.786564, -2.036735, 0.012980, 1.944887, -170.930000] + inc_poly_cylinder.test_vals = [-8.030976, -2.362995, 0.006829, 1.923532, -172.590000] test_list.append(inc_poly_cylinder) # X-coarse laminar bend as a mixed element CGNS test @@ -1209,7 +1209,7 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [19.000000, -1.778863, -2.040209] + slinc_steady.test_vals = [19.000000, -1.012869, -1.222087] slinc_steady.timeout = 100 slinc_steady.tol = 0.00002 slinc_steady.multizone = True @@ -1345,7 +1345,7 @@ def main(): cht_incompressible.cfg_dir = "coupled_cht/incomp_2d" cht_incompressible.cfg_file = "cht_2d_3cylinders.cfg" cht_incompressible.test_iter = 10 - cht_incompressible.test_vals = [-2.128827, -0.588812, -0.588812, -0.588812] + cht_incompressible.test_vals = [-1.376348, -0.591208, -0.591208, -0.591208] cht_incompressible.multizone = True test_list.append(cht_incompressible) @@ -1363,7 +1363,7 @@ def main(): sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" sp_pinArray_cht_2d_dp_hf.cfg_file = "configMaster.cfg" sp_pinArray_cht_2d_dp_hf.test_iter = 100 - sp_pinArray_cht_2d_dp_hf.test_vals = [0.374853, -0.882716, -0.970590, -0.613374, 208.023676, 350.230000, -0.000000, -0.613370, 0.613370] + sp_pinArray_cht_2d_dp_hf.test_vals = [0.379544, 2.491817, -1.255558, -0.613405, 208.023676, 349.870000, -0.000000, -0.613410, 0.613410] sp_pinArray_cht_2d_dp_hf.multizone = True test_list.append(sp_pinArray_cht_2d_dp_hf) @@ -1372,7 +1372,7 @@ def main(): sp_pinArray_3d_cht_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_3d" sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 - sp_pinArray_3d_cht_mf_hf_tp.test_vals = [-1.279608, -2.263747, -3.397255, -0.009777, 104.609505, 418.370000, 0.000000] + sp_pinArray_3d_cht_mf_hf_tp.test_vals = [0.261726, 3.878700, 0.298987, -0.009537, 104.749181, 354.800000, 0.000000] sp_pinArray_3d_cht_mf_hf_tp.multizone = True test_list.append(sp_pinArray_3d_cht_mf_hf_tp) @@ -1488,7 +1488,7 @@ def main(): pywrapper_buoyancy.cfg_dir = "py_wrapper/custom_source_buoyancy" pywrapper_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg" pywrapper_buoyancy.test_iter = 0 - pywrapper_buoyancy.test_vals = [-17.746020, -17.462127, -17.428851, -12.260605] + pywrapper_buoyancy.test_vals = [-11.864224, -12.149668, -3.539309, -6.119375] pywrapper_buoyancy.test_vals_aarch64 = [-17.746018, -17.460693, -17.430708, -12.260624] pywrapper_buoyancy.command = TestCase.Command("mpirun -np 2", "python", "run.py") test_list.append(pywrapper_buoyancy) @@ -1498,7 +1498,7 @@ def main(): pywrapper_zimont.cfg_dir = "py_wrapper/turbulent_premixed_psi" pywrapper_zimont.cfg_file = "psi.cfg" pywrapper_zimont.test_iter = 0 - pywrapper_zimont.test_vals = [-3.229704, -1.602176, -3.904854, -2.631849, 0.752828, -3.498356] + pywrapper_zimont.test_vals = [-5.532006, -4.663972, -5.838306, -4.316956, -2.073665, -4.453762] pywrapper_zimont.command = TestCase.Command("mpirun -np 2", "python", "run.py") test_list.append(pywrapper_zimont) @@ -1578,7 +1578,7 @@ def main(): species2_primitiveVenturi_mixingmodel.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel.cfg_file = "species2_primitiveVenturi_mixingmodel.cfg" species2_primitiveVenturi_mixingmodel.test_iter = 50 - species2_primitiveVenturi_mixingmodel.test_vals = [-5.741491, -4.566437, -4.672755, -5.777257, -0.068325, -5.584627, 5.000000, -1.368747, 5.000000, -4.868573, 5.000000, -1.452304, 0.000376, 0.000359, 0.000016, 0.000000] + species2_primitiveVenturi_mixingmodel.test_vals = [ -5.737415, -4.566668, -4.671780, -5.777603, -0.066800, -5.583554, 5.000000, -1.373807, 5.000000, -4.869219, 5.000000, -1.453021, 0.000381, 0.000365, 0.000016, 0.000000] test_list.append(species2_primitiveVenturi_mixingmodel) # 2 species (1 eq) primitive venturi mixing using mixing model and bounded scalar transport @@ -1586,7 +1586,7 @@ def main(): species2_primitiveVenturi_mixingmodel_boundedscalar.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel_boundedscalar.cfg_file = "species2_primitiveVenturi_mixingmodel_boundedscalar.cfg" species2_primitiveVenturi_mixingmodel_boundedscalar.test_iter = 50 - species2_primitiveVenturi_mixingmodel_boundedscalar.test_vals = [-5.691987, -4.511898, -4.616477, -5.776937, -0.113163, -5.705283, 5.000000, -1.430668, 5.000000, -4.923447, 5.000000, -1.771537, 0.000318, 0.000318, 0.000000, 0.000000] + species2_primitiveVenturi_mixingmodel_boundedscalar.test_vals = [-5.690396, -4.512158, -4.616488, -5.776093, -0.113176, -5.705291, 5.000000, -1.433234, 5.000000, -4.921121, 5.000000, -1.770744, 0.000318, 0.000318, 0.000000, 0.000000] test_list.append(species2_primitiveVenturi_mixingmodel_boundedscalar) # 2 species (1 eq) primitive venturi mixing using mixing model including viscosity, thermal conductivity and inlet markers for SA turbulence model @@ -1594,7 +1594,7 @@ def main(): species2_primitiveVenturi_mixingmodel_viscosity.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel_viscosity.cfg_file = "species2_primitiveVenturi_mixingmodel_viscosity.cfg" species2_primitiveVenturi_mixingmodel_viscosity.test_iter = 50 - species2_primitiveVenturi_mixingmodel_viscosity.test_vals = [-5.236181, -3.624224, -3.871405, -7.533947, -5.128207, 5.000000, -1.678081, 5.000000, -3.489246, 5.000000, -2.086184, 2.495408, 0.985469, 0.600247, 0.909691] + species2_primitiveVenturi_mixingmodel_viscosity.test_vals = [-5.239118, -3.624947, -3.874462, -7.535191, -5.130418, 5.000000, -1.677376, 5.000000, -3.493540, 5.000000, -2.085009, 2.495398, 0.985401, 0.600225, 0.909772] test_list.append(species2_primitiveVenturi_mixingmodel_viscosity) # 2 species (1 eq) primitive venturi mixing using mixing model including heat capacity and mass diffusivity @@ -1602,7 +1602,7 @@ def main(): species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg_file = "species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg" species2_primitiveVenturi_mixingmodel_heatcapacity_H2.test_iter = 50 - species2_primitiveVenturi_mixingmodel_heatcapacity_H2.test_vals = [-5.835345, -4.512778, -4.659961, -6.941393, 2.322419, -5.509186, 30.000000, -6.906068, 11.000000, -8.236295, 8.000000, -9.290696, 2.077551, 1.000000, 0.600000, 0.477551] + species2_primitiveVenturi_mixingmodel_heatcapacity_H2.test_vals = [-5.824346, -4.632948, -4.560590, -6.765715, 2.076808, -5.480881, 30.000000, -7.315121, 12.000000, -8.059064, 8.000000, -8.896288, 2.092262, 1.000000, 0.600000, 0.492262] test_list.append(species2_primitiveVenturi_mixingmodel_heatcapacity_H2) # 2 species (1 eq) primitive venturi mixing using mixing model including heat capacity and mass diffusivity NonDimensional case @@ -1610,9 +1610,25 @@ def main(): species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg_file = "species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg" species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.test_iter = 50 - species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.test_vals = [-5.418710, -4.796715, -4.930132, -7.722998, 2.018220, -5.114320, 10.000000, -2.265326, 4.000000, -5.351738, 4.000000, -5.060011, 2.077776, 1.000000, 0.600000, 0.477776] + species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.test_vals = [-5.400769, -4.916015, -4.837449, -7.711760, 1.771402, -5.087077, 10.000000, -2.744436, 3.000000, -5.095706, 5.000000, -5.856784, 2.092358, 1.000000, 0.600000, 0.492358] test_list.append(species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND) + # 2 species (1 eq) primitive venturi mixing using mixing model solving enthalpy equation using preconditioning + JST convective scheme + species2_primitiveVenturi_JST = TestCase('species2_primitiveVenturi_JST.cfg') + species2_primitiveVenturi_JST.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_JST.cfg_file = "species2_primitiveVenturi_JST.cfg" + species2_primitiveVenturi_JST.test_iter = 50 + species2_primitiveVenturi_JST.test_vals = [-6.035464, -7.071918, -7.201080, -1.142940, -8.348316, 10.000000, -3.223791, 10.000000, -4.435519, 0.049048, 0.014468, 0.020068, 0.014512, 25.000000] + test_list.append(species2_primitiveVenturi_JST) + + # 2 species (1 eq) primitive venturi mixing using mixing model solving enthalpy equation using preconditioning + Lax-Friedrich convective scheme + species2_primitiveVenturi_Lax_Friedrich = TestCase('species2_primitiveVenturi_Lax_Friedrich.cfg') + species2_primitiveVenturi_Lax_Friedrich.cfg_dir = "species_transport/venturi_primitive_3species" + species2_primitiveVenturi_Lax_Friedrich.cfg_file = "species2_primitiveVenturi_Lax_Friedrich.cfg" + species2_primitiveVenturi_Lax_Friedrich.test_iter = 50 + species2_primitiveVenturi_Lax_Friedrich.test_vals = [-6.092441, -6.981653, -6.982959, -1.195023, -8.245626, 10.000000, -3.472515, 8.000000, -5.356121, 0.048943, 0.014468, 0.020007, 0.014468, 12.500000] + test_list.append(species2_primitiveVenturi_Lax_Friedrich) + # 2 species (1 eq) primitive venturi mixing species2_primitiveVenturi = TestCase('species2_primitiveVenturi') species2_primitiveVenturi.cfg_dir = "species_transport/venturi_primitive_3species" @@ -1634,7 +1650,7 @@ def main(): species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg_file = "species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg" species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.test_iter = 50 - species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.test_vals = [-4.552043, -1.787188, -1.552953, -0.964948, 1.707903, -3.855700, 24.000000, -5.203239, 10.000000, -5.176998, 3.000000, -5.329906, 2.000000, 1.000000, 0.000000, 1.000000] + species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.test_vals = [-4.767010, -1.818299, -1.842427, -0.615338, 1.366173, -3.921308, 21.000000, -5.213096, 9.000000, -5.422897, 4.000000, -5.919063, 2.000000, 1.000000, 0.000000, 1.000000] test_list.append(species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS) # 3 species (2 eq) primitive venturi mixing with inlet files. @@ -1651,8 +1667,8 @@ def main(): species_passive_val.cfg_dir = "species_transport/passive_transport_validation" species_passive_val.cfg_file = "passive_transport.cfg" species_passive_val.test_iter = 50 - species_passive_val.test_vals = [-16.513090, -16.281772, -16.906963, -4.257599, 10.000000, -4.263917, 8.000000, -5.193350, 0.186610, 0.000000] - species_passive_val.test_vals_aarch64 = [-16.571193, -16.335237, -16.927990, -4.257599, 10.000000, -4.179271, 8.000000, -5.193350, 0.186610, 0.000000] + species_passive_val.test_vals = [-16.517744, -16.282420, -16.871663, -4.257599, 10.000000, -4.278151, 8.000000, -5.193350, 0.186610, 0.000000] + species_passive_val.test_vals_aarch64 = [-16.517744, -16.282420, -16.871663, -4.257599, 10.000000, -4.278151, 8.000000, -5.193350, 0.186610, 0.000000] test_list.append(species_passive_val) # rectangle active 2-species transport @@ -1660,8 +1676,8 @@ def main(): species_active_transport_temp_limits.cfg_dir = "species_transport/passive_transport_validation" species_active_transport_temp_limits.cfg_file = "active_species_transport_temp_limits.cfg" species_active_transport_temp_limits.test_iter = 50 - species_active_transport_temp_limits.test_vals = [-2.340885, -2.257725, -1.926927, -3.236329, 9.000000, -5.006265, 4.000000, -5.931361, 1.646370, 0.993308, 0.000445, 0.652617] - species_active_transport_temp_limits.test_vals_aarch64 = [-2.340885, -2.257725, -1.926927, -3.236329, 9.000000, -5.006265, 4.000000, -5.931361, 1.646370, 0.993308, 0.000445, 0.652617] + species_active_transport_temp_limits.test_vals = [-1.785041, -2.565628, 2.460433, -3.188111, 9.000000, -5.551493, 3.000000, -5.826106, 1.456438, 0.998134, 0.001475, 0.456829] + species_active_transport_temp_limits.test_vals_aarch64 = [-1.785041, -2.565628, 2.460433, -3.188111, 9.000000, -5.551493, 3.000000, -5.826106, 1.456438, 0.998134, 0.001475, 0.456829] test_list.append(species_active_transport_temp_limits) # species transport, 3 species with multizone (2 fluid regions) @@ -1669,7 +1685,7 @@ def main(): species3_multizone_restart.cfg_dir = "species_transport/multizone" species3_multizone_restart.cfg_file = "configMaster.cfg" species3_multizone_restart.test_iter = 5 - species3_multizone_restart.test_vals = [-3.723247, -3.108855] + species3_multizone_restart.test_vals = [-4.634484, -4.515504] species3_multizone_restart.multizone = True test_list.append(species3_multizone_restart) @@ -1695,7 +1711,7 @@ def main(): cfd_flamelet_ch4_cht.cfg_dir = "flamelet/03_laminar_premixed_ch4_flame_cht_cfd" cfd_flamelet_ch4_cht.cfg_file = "lam_prem_ch4_cht_cfd_master.cfg" cfd_flamelet_ch4_cht.test_iter = 5 - cfd_flamelet_ch4_cht.test_vals = [-10.166224, -9.299576, -10.022482, -11.907558, -3.447626, -12.290421, -13.719415, -6.864920] + cfd_flamelet_ch4_cht.test_vals = [-7.209184, -6.102044, -7.491447, -9.317122, -3.204897, -9.811662, -13.554684, -6.864880] cfd_flamelet_ch4_cht.timeout = 1600 cfd_flamelet_ch4_cht.multizone = True test_list.append(cfd_flamelet_ch4_cht) diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 6ec2dab175fe..b5cbd2eee1d4 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -116,7 +116,7 @@ def main(): discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 - discadj_incomp_cylinder.test_vals = [20.000000, -2.082673, -2.013587, 0.000000] + discadj_incomp_cylinder.test_vals = [20.000000, -5.181765, -3.840710, 0.000000] test_list.append(discadj_incomp_cylinder) ###################################### @@ -256,7 +256,7 @@ def main(): discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 - discadj_heat.test_vals = [-2.001337, 0.655543, 0.000000, 0.006170] + discadj_heat.test_vals = [-1.928244, 0.730865, 0.000000, -3.993500] test_list.append(discadj_heat) ################################### @@ -290,7 +290,7 @@ def main(): discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d" discadj_cht.cfg_file = "cht_2d_3cylinders.cfg" discadj_cht.test_iter = 10 - discadj_cht.test_vals = [-2.955510, -3.085549, -3.085516, -3.085511] + discadj_cht.test_vals = [-6.131109, -2.564634, -2.565220, -2.565303] test_list.append(discadj_cht) # 2D DA cht streamwise periodic case, 2 zones, avg temp objective @@ -298,7 +298,7 @@ def main(): da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - da_sp_pinArray_cht_2d_dp_hf.test_vals = [-5.081814, -3.881868, -4.127717] + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-3.907317, -5.155811, -3.183956] da_sp_pinArray_cht_2d_dp_hf.multizone = True test_list.append(da_sp_pinArray_cht_2d_dp_hf) @@ -307,7 +307,7 @@ def main(): da_sp_pinArray_cht_2d_mf.cfg_dir = "incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d" da_sp_pinArray_cht_2d_mf.cfg_file = "configMaster.cfg" da_sp_pinArray_cht_2d_mf.test_iter = 100 - da_sp_pinArray_cht_2d_mf.test_vals = [-4.512241, -1.154741, -1.436747, -18.499579, 0.148431, -5.675770, -19.074432, -50.463572] + da_sp_pinArray_cht_2d_mf.test_vals = [-4.512241, -1.154741, -1.436747, 0.148439, -5.675767, -15.727696, -50.4635702] da_sp_pinArray_cht_2d_mf.multizone = True test_list.append(da_sp_pinArray_cht_2d_mf) @@ -316,8 +316,8 @@ def main(): da_unsteadyCHT_cylinder.cfg_dir = "coupled_cht/disc_adj_unsteadyCHT_cylinder" da_unsteadyCHT_cylinder.cfg_file = "chtMaster.cfg" da_unsteadyCHT_cylinder.test_iter = 2 - da_unsteadyCHT_cylinder.test_vals = [-3.508906, -4.317739, -4.241558, -11.836892, -12.862648, 0.000000, 3.688000, 0.295190] - da_unsteadyCHT_cylinder.test_vals_aarch64 = [-3.508906, -4.317739, -4.241558, -11.836892, -12.862650, 0.000000, 3.688000, 0.295190] + da_unsteadyCHT_cylinder.test_vals = [-12.131633, -12.617906, -12.688933, -16.179747, -6.432277, 0.000000, 75.761000, 0.247780] + da_unsteadyCHT_cylinder.test_vals_aarch64 = [-12.131633, -12.617906, -12.688933, -16.179747, -6.432277, 0.000000, 75.761000, 0.247780] da_unsteadyCHT_cylinder.unsteady = True da_unsteadyCHT_cylinder.multizone = True test_list.append(da_unsteadyCHT_cylinder) @@ -332,7 +332,7 @@ def main(): discadj_flamelet_ch4_hx.cfg_file = "lam_prem_ch4_hx_ad.cfg" discadj_flamelet_ch4_hx.multizone = False discadj_flamelet_ch4_hx.test_iter = 10 - discadj_flamelet_ch4_hx.test_vals = [-8.699008, -8.604699, -8.816298, -6.626855, -14.620943, -3.249062, -18.930953] + discadj_flamelet_ch4_hx.test_vals = [-8.717448, -8.450564, -8.766800, -6.626764, -14.602479, -3.248656, -18.930954] test_list.append(discadj_flamelet_ch4_hx) # 2D planar laminar premixed flame on isothermal burner with conjugate heat transfer (restart) @@ -341,7 +341,7 @@ def main(): discadj_flamelet_ch4_cht.cfg_file = "lam_prem_ch4_cht_ad_master.cfg" discadj_flamelet_ch4_cht.multizone = True discadj_flamelet_ch4_cht.test_iter = 10 - discadj_flamelet_ch4_cht.test_vals = [-2.760027, -1.999839, -2.096537, -0.153424, -7.289370, -18.655063, -18.622003, -4.847179] + discadj_flamelet_ch4_cht.test_vals = [-2.764345, -1.998773, -2.082310, -0.140923, -7.287831, -18.655078, -18.622026, -4.847187] test_list.append(discadj_flamelet_ch4_cht) ###################################### diff --git a/TestCases/py_wrapper/custom_source_buoyancy/lam_buoyancy_cavity.cfg b/TestCases/py_wrapper/custom_source_buoyancy/lam_buoyancy_cavity.cfg index 718f9207332d..6329eaf739c5 100644 --- a/TestCases/py_wrapper/custom_source_buoyancy/lam_buoyancy_cavity.cfg +++ b/TestCases/py_wrapper/custom_source_buoyancy/lam_buoyancy_cavity.cfg @@ -114,7 +114,7 @@ GRAD_OBJFUNC_FILENAME= of_grad.dat SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint OUTPUT_WRT_FREQ= 10 -SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_TEMPERATURE) +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_ENTHALPY) WRT_PERFORMANCE= YES PYTHON_CUSTOM_SOURCE= YES diff --git a/TestCases/py_wrapper/turbulent_premixed_psi/run.py b/TestCases/py_wrapper/turbulent_premixed_psi/run.py index 8b418785bbc3..dc1133169a24 100644 --- a/TestCases/py_wrapper/turbulent_premixed_psi/run.py +++ b/TestCases/py_wrapper/turbulent_premixed_psi/run.py @@ -95,8 +95,14 @@ def update_temperature(SU2Driver, iPoint): iFLOWSOLVER = SU2Driver.GetSolverIndices()['INC.FLOW'] # the list with names solindex = getsolvar(SU2Driver) + primindex = SU2Driver.GetPrimitiveIndices() + # get Cp + iCp = primindex.get("CP_TOTAL") + Cp = SU2Driver.Primitives()(iPoint,iCp) + # get solution index for energy equation iTEMP = solindex.get("TEMPERATURE") - SU2Driver.Solution(iFLOWSOLVER).Set(iPoint,iTEMP,T) + # set enthalpy, for Ideal Gas model, enthalpy is Cp*T + SU2Driver.Solution(iFLOWSOLVER).Set(iPoint,iTEMP,Cp*T) # ################################################################## # diff --git a/TestCases/radiation/p1model/configp1.cfg b/TestCases/radiation/p1model/configp1.cfg index 1a3a9692ebec..6c779b16d0fb 100644 --- a/TestCases/radiation/p1model/configp1.cfg +++ b/TestCases/radiation/p1model/configp1.cfg @@ -96,7 +96,7 @@ CONV_CAUCHY_EPS= 1E-6 % OUTPUT %%%%%%%%%%%%%%%%%%%%%%% -SCREEN_OUTPUT = (INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, RMS_TEMPERATURE, RMS_RAD_ENERGY, TOTAL_HEATFLUX) +SCREEN_OUTPUT = (INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, RMS_ENTHALPY, RMS_RAD_ENERGY, TOTAL_HEATFLUX) MESH_FORMAT= SU2 MESH_FILENAME= meshp1.su2 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 94bc257ddb8c..1d06f1aa8d5d 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -415,7 +415,7 @@ def main(): inc_poly_cylinder.cfg_dir = "incomp_navierstokes/cylinder" inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" inc_poly_cylinder.test_iter = 20 - inc_poly_cylinder.test_vals = [-8.083556, -2.134369, 0.018999, 1.932938, -173.730000] + inc_poly_cylinder.test_vals = [-8.232551, -2.412865, 0.010163, 1.895333, -172.760000] test_list.append(inc_poly_cylinder) # X-coarse laminar bend as a mixed element CGNS test @@ -986,7 +986,7 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [19.000000, -1.803732, -2.108492] + slinc_steady.test_vals = [19.000000, -1.049468, -1.303013] slinc_steady.timeout = 100 slinc_steady.multizone = True test_list.append(slinc_steady) @@ -1117,7 +1117,7 @@ def main(): cht_incompressible.cfg_dir = "coupled_cht/incomp_2d" cht_incompressible.cfg_file = "cht_2d_3cylinders.cfg" cht_incompressible.test_iter = 10 - cht_incompressible.test_vals = [-2.128826, -0.588813, -0.588813, -0.588813] + cht_incompressible.test_vals = [-1.376347, -0.591210, -0.591210, -0.591210] cht_incompressible.multizone = True test_list.append(cht_incompressible) diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index dbe43b1faf63..0cb1b5715891 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -120,7 +120,7 @@ def main(): discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 - discadj_incomp_cylinder.test_vals = [20.000000, -2.386480, -2.408986, 0.000000] + discadj_incomp_cylinder.test_vals = [20.000000, -5.097821, -3.842739, 0.000000] test_list.append(discadj_incomp_cylinder) ####################################################### @@ -194,7 +194,7 @@ def main(): discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 - discadj_heat.test_vals = [-2.178141, 0.578576, 0.000000, 0.008712] + discadj_heat.test_vals = [-2.685957, 0.665986, 0.000000, -9.155800] test_list.append(discadj_heat) ################################### @@ -219,7 +219,7 @@ def main(): discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d" discadj_cht.cfg_file = "cht_2d_3cylinders.cfg" discadj_cht.test_iter = 10 - discadj_cht.test_vals = [-2.955506, -3.085551, -3.085518, -3.085513] + discadj_cht.test_vals = [-6.131112, -2.564634, -2.565220, -2.565304] test_list.append(discadj_cht) ###################################### diff --git a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_JST.cfg b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_JST.cfg new file mode 100644 index 000000000000..2bd04a386be3 --- /dev/null +++ b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_JST.cfg @@ -0,0 +1,153 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Species mixing with 2 species: Hydrogen and air. % +% 1 transport equation is being solved(For H2 in this case). % +% Including JST scheme with preconditioning for enthalpy. % +% Author: Cristopher Morales Ubal % +% Institution: Eindhoven University of Technology % +% Date: 2025/06/27 % +% File Version 8.0.1 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_NAVIER_STOKES +KIND_TURB_MODEL= NONE +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= VARIABLE +INC_DENSITY_INIT= 0.0807 +% +INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) +% +INC_ENERGY_EQUATION= YES +INC_TEMPERATURE_INIT= 350.0 +% +INC_NONDIM= DIMENSIONAL +% +% -------------------- FLUID PROPERTIES ------------------------------------- % +% +FLUID_MODEL= FLUID_MIXTURE +% +THERMODYNAMIC_PRESSURE= 101325.0 +% +MOLECULAR_WEIGHT= 2.01588, 28.960 +% +SPECIFIC_HEAT_CP = 14310, 1009.39 +% +CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY +THERMAL_CONDUCTIVITY_CONSTANT= 0.187, 0.0258 +% +PRANDTL_LAM= 0.72, 0.72 +TURBULENT_CONDUCTIVITY_MODEL= NONE +PRANDTL_TURB= 0.90, 0.90 +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +MU_CONSTANT= 8.9E-06, 1.8551E-05 +% +MU_REF= 8.411E-05, 1.716E-05 +% +MU_T_REF= 273, 273 +% +SUTHERLAND_CONSTANT= 97, 111 +% +MIXING_VISCOSITY_MODEL = WILKE +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_HEATFLUX= ( wall, 0.0) +MARKER_SYM= ( axis ) +% +SPECIFIED_INLET_PROFILE= NO +INLET_FILENAME= inlet_venturi.dat +INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET +MARKER_INLET= ( gas_inlet, 350, 0.1, 1.0, 0.0, 0.0,\ + air_axial_inlet, 300, 0.1, 0.0, -1.0, 0.0 ) +MARKER_INLET_SPECIES= (gas_inlet, 0.014467517838966, \ + air_axial_inlet, 0.020137986304114414) +% +INC_OUTLET_TYPE= PRESSURE_OUTLET +MARKER_OUTLET= ( outlet, 0.0 ) +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +% +CFL_NUMBER= 100 +CFL_REDUCTION_SPECIES= 1.0 +CFL_REDUCTION_TURB= 1.0 +CFL_ADAPT= YES +CFL_ADAPT_PARAM= ( 0.5, 2.0, 10, 1000, 1E-4) +% +% Run commented Iter for good results +ITER= 2000 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-5 +LINEAR_SOLVER_ITER= 10 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= JST +MUSCL_FLOW= NO +SLOPE_LIMITER_FLOW = NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- SCALAR TRANSPORT ---------------------------------------% +% +KIND_SCALAR_MODEL= SPECIES_TRANSPORT +% +DIFFUSIVITY_MODEL = UNITY_LEWIS +% +CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR +MUSCL_SPECIES= NO +SLOPE_LIMITER_SPECIES = NONE +% +TIME_DISCRE_SPECIES= EULER_IMPLICIT +% +SPECIES_INIT= 0.014467517838966 +SPECIES_CLIPPING= NO +SPECIES_CLIPPING_MIN= 0.0 +SPECIES_CLIPPING_MAX= 1.0 +% +% -------------------- TURBULENT TRANSPORT ---------------------------------------% +% +CONV_NUM_METHOD_TURB= BOUNDED_SCALAR +MUSCL_TURB= NO +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_FIELD= RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_SPECIES +CONV_RESIDUAL_MINVAL= -18 +CONV_STARTITER= 10 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= primitiveVenturi.su2 +SCREEN_OUTPUT= INNER_ITER WALL_TIME \ + RMS_PRESSURE RMS_VELOCITY-X RMS_VELOCITY-Y RMS_ENTHALPY RMS_SPECIES_0 \ + LINSOL_ITER LINSOL_RESIDUAL \ + LINSOL_ITER_SPECIES LINSOL_RESIDUAL_SPECIES \ + SURFACE_SPECIES_0 AVG_CFL +SCREEN_WRT_FREQ_INNER= 10 +% +HISTORY_OUTPUT= ITER RMS_RES LINSOL SPECIES_COEFF SPECIES_COEFF_SURF +CONV_FILENAME= history +MARKER_ANALYZE= gas_inlet, air_axial_inlet, outlet +MARKER_ANALYZE_AVERAGE= AREA +% +OUTPUT_FILES= RESTART_ASCII, PARAVIEW_MULTIBLOCK +VOLUME_OUTPUT= RESIDUAL, PRIMITIVE, TIMESTEP +OUTPUT_WRT_FREQ= 1000 +% +RESTART_SOL= NO +READ_BINARY_RESTART= NO diff --git a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_Lax_Friedrich.cfg b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_Lax_Friedrich.cfg new file mode 100644 index 000000000000..dbe7fde8ebfc --- /dev/null +++ b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_Lax_Friedrich.cfg @@ -0,0 +1,155 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Species mixing with 2 species: Hydrogen and air. % +% 1 transport equation is being solved(For H2 in this case). % +% Including Lax-Friedrich scheme with preconditioning % +% solving for enthalpy. % +% Author: Cristopher Morales Ubal % +% Institution: Eindhoven University of Technology % +% Date: 2022/06/27 % +% File Version 8.0.1 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_NAVIER_STOKES +KIND_TURB_MODEL= NONE +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= VARIABLE +INC_DENSITY_INIT= 0.0807 +% +INC_VELOCITY_INIT= ( 0.1, 0.0, 0.0 ) +% +INC_ENERGY_EQUATION= YES +INC_TEMPERATURE_INIT= 350.0 +% +INC_NONDIM= DIMENSIONAL +% +% -------------------- FLUID PROPERTIES ------------------------------------- % +% +FLUID_MODEL= FLUID_MIXTURE +% +THERMODYNAMIC_PRESSURE= 101325.0 +% +MOLECULAR_WEIGHT= 2.01588, 28.960 +% +SPECIFIC_HEAT_CP = 14310, 1009.39 +% +CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY +THERMAL_CONDUCTIVITY_CONSTANT= 0.187, 0.0258 +% +PRANDTL_LAM= 0.72, 0.72 +TURBULENT_CONDUCTIVITY_MODEL= NONE +PRANDTL_TURB= 0.90, 0.90 +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +MU_CONSTANT= 8.9E-06, 1.8551E-05 +% +MU_REF= 8.411E-05, 1.716E-05 +% +MU_T_REF= 273, 273 +% +SUTHERLAND_CONSTANT= 97, 111 +% +MIXING_VISCOSITY_MODEL = WILKE +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_HEATFLUX= ( wall, 0.0) +MARKER_SYM= ( axis ) +% +SPECIFIED_INLET_PROFILE= NO +INLET_FILENAME= inlet_venturi.dat +INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET +MARKER_INLET= ( gas_inlet, 350, 0.1, 1.0, 0.0, 0.0,\ + air_axial_inlet, 300, 0.1, 0.0, -1.0, 0.0 ) +MARKER_INLET_SPECIES= (gas_inlet, 0.014467517838966, \ + air_axial_inlet, 0.020137986304114414) +% +INC_OUTLET_TYPE= PRESSURE_OUTLET +MARKER_OUTLET= ( outlet, 0.0 ) +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +% +CFL_NUMBER= 100 +CFL_REDUCTION_SPECIES= 1.0 +CFL_REDUCTION_TURB= 1.0 +CFL_ADAPT= YES +CFL_ADAPT_PARAM= ( 0.5, 2.0, 10, 1000, 1E-4) +% +% Run commented Iter for good results +ITER= 2000 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-5 +LINEAR_SOLVER_ITER= 10 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= LAX-FRIEDRICH +LAX_SENSOR_COEFF = 0.01 +MUSCL_FLOW= NO +SLOPE_LIMITER_FLOW = NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- SCALAR TRANSPORT ---------------------------------------% +% +KIND_SCALAR_MODEL= SPECIES_TRANSPORT +% +DIFFUSIVITY_MODEL = UNITY_LEWIS +% +CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR +MUSCL_SPECIES= NO +SLOPE_LIMITER_SPECIES = NONE +% +TIME_DISCRE_SPECIES= EULER_IMPLICIT +% +SPECIES_INIT= 0.014467517838966 +SPECIES_CLIPPING= NO +SPECIES_CLIPPING_MIN= 0.0 +SPECIES_CLIPPING_MAX= 1.0 +% +% -------------------- TURBULENT TRANSPORT ---------------------------------------% +% +CONV_NUM_METHOD_TURB= BOUNDED_SCALAR +MUSCL_TURB= NO +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_FIELD= RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_SPECIES +CONV_RESIDUAL_MINVAL= -18 +CONV_STARTITER= 10 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= primitiveVenturi.su2 +SCREEN_OUTPUT= INNER_ITER WALL_TIME \ + RMS_PRESSURE RMS_VELOCITY-X RMS_VELOCITY-Y RMS_ENTHALPY RMS_SPECIES_0 \ + LINSOL_ITER LINSOL_RESIDUAL \ + LINSOL_ITER_SPECIES LINSOL_RESIDUAL_SPECIES \ + SURFACE_SPECIES_0 AVG_CFL +SCREEN_WRT_FREQ_INNER= 10 +% +HISTORY_OUTPUT= ITER RMS_RES LINSOL SPECIES_COEFF SPECIES_COEFF_SURF +CONV_FILENAME= history +MARKER_ANALYZE= gas_inlet, air_axial_inlet, outlet +MARKER_ANALYZE_AVERAGE= AREA +% +OUTPUT_FILES= RESTART_ASCII, PARAVIEW_MULTIBLOCK +VOLUME_OUTPUT= RESIDUAL, PRIMITIVE, TIMESTEP +OUTPUT_WRT_FREQ= 1000 +% +RESTART_SOL= NO +READ_BINARY_RESTART= NO diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index ca6976019942..ae8df575b97e 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -49,7 +49,7 @@ def main(): cht_incompressible_unsteady.cfg_dir = "../Tutorials/multiphysics/unsteady_cht/" cht_incompressible_unsteady.cfg_file = "cht_2d_3cylinders.cfg" cht_incompressible_unsteady.test_iter = 2 - cht_incompressible_unsteady.test_vals = [-2.659390, -2.533160, -0.080399, -0.080399, -0.080399, -12.421450, 0.000000, 0, 0, 0, 0, 2.3824e+02] #last columns + cht_incompressible_unsteady.test_vals = [-2.661443, -2.546289, -0.080399, -0.080399, -0.080399, -12.421980, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 238.240000] #last columns cht_incompressible_unsteady.multizone = True cht_incompressible_unsteady.unsteady = True test_list.append(cht_incompressible_unsteady) @@ -59,7 +59,7 @@ def main(): cht_incompressible.cfg_dir = "../Tutorials/multiphysics/steady_cht" cht_incompressible.cfg_file = "cht_2d_3cylinders.cfg" cht_incompressible.test_iter = 10 - cht_incompressible.test_vals = [-2.128826, -0.588813, -0.588813, -0.588813] #last 4 columns + cht_incompressible.test_vals = [-1.376347, -0.591210, -0.591210, -0.591210] #last 4 columns cht_incompressible.command = TestCase.Command(exec = "SU2_CFD") cht_incompressible.multizone = True test_list.append(cht_incompressible) @@ -69,7 +69,7 @@ def main(): cht_CR.cfg_dir = "../Tutorials/multiphysics/contact_resistance_cht" cht_CR.cfg_file = "master.cfg" cht_CR.test_iter = 80 - cht_CR.test_vals = [-8.606916, -9.227614, -10.411673, -2.114949] + cht_CR.test_vals = [-8.606916, -9.227614, -10.411674, -2.116659] cht_CR.multizone = True test_list.append(cht_CR) @@ -80,7 +80,7 @@ def main(): sp_pinArray_2d_mf_hf.cfg_dir = "../Tutorials/incompressible_flow/Inc_Streamwise_Periodic" sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" sp_pinArray_2d_mf_hf.test_iter = 25 - sp_pinArray_2d_mf_hf.test_vals = [-4.685950, 1.388066, -0.755449, 241.878890] + sp_pinArray_2d_mf_hf.test_vals = [-4.685131, 1.388616, -0.755475, 241.878084] sp_pinArray_2d_mf_hf.test_vals_aarch64 = [-4.686092, 1.387918, -0.755447, 241.878841] test_list.append(sp_pinArray_2d_mf_hf) @@ -89,7 +89,7 @@ def main(): sp_pinArray_2d_dp_hf_tp.cfg_dir = "../Tutorials/incompressible_flow/Inc_Streamwise_Periodic" sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" sp_pinArray_2d_dp_hf_tp.test_iter = 25 - sp_pinArray_2d_dp_hf_tp.test_vals = [-4.732729, 1.326135, -0.713419, 208.023676] + sp_pinArray_2d_dp_hf_tp.test_vals = [-4.737196, 1.322378, -0.713373, 208.023676] sp_pinArray_2d_dp_hf_tp.test_vals_aarch64 = [-4.733643, 1.325195, -0.713411, 208.023676] test_list.append(sp_pinArray_2d_dp_hf_tp) @@ -144,7 +144,7 @@ def main(): DAspecies3_primitiveVenturi.cfg_dir = "../Tutorials/incompressible_flow/Inc_Species_Transport" DAspecies3_primitiveVenturi.cfg_file = "DAspecies3_primitiveVenturi.cfg" DAspecies3_primitiveVenturi.test_iter = 50 - DAspecies3_primitiveVenturi.test_vals = [-9.806113, -8.630821, -8.666250, -8.333798, -12.914857, -11.017067, -10.232083] + DAspecies3_primitiveVenturi.test_vals = [-9.819097, -8.643457, -8.676919, -8.347340, -12.926241, -9.739487, -8.947991] DAspecies3_primitiveVenturi.command = TestCase.Command("mpirun -n 2", "SU2_CFD_AD") test_list.append(DAspecies3_primitiveVenturi) @@ -153,7 +153,7 @@ def main(): kenics_mixer_tutorial.cfg_dir = "../Tutorials/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model" kenics_mixer_tutorial.cfg_file = "kenics_mixer_tutorial.cfg" kenics_mixer_tutorial.test_iter = 10 - kenics_mixer_tutorial.test_vals = [-7.489818, -6.823672, -6.838301, -6.378918, -7.906045, -3.060796, -7.447919, 5.000000, -1.861690, 4.000000, -5.319671, 3.000000, -6.376137, 0.025476, 0.000000, 0.025476, 0.000000, 64.093000, 8.470600, 48.094000, 7.527900] + kenics_mixer_tutorial.test_vals = [-7.490303, -6.823796, -6.838369, -6.383332, -7.907780, -3.062276, -7.451176, 5.000000, -1.858354, 4.000000, -5.318193, 3.000000, -6.371744, 0.025671, 0.000000, 0.025671, 0.000000, 62.846000, 8.470600, 46.847000, 7.527900] kenics_mixer_tutorial.command = TestCase.Command("mpirun -n 2", "SU2_CFD") test_list.append(kenics_mixer_tutorial) @@ -165,7 +165,7 @@ def main(): premixed_hydrogen.cfg_dir = "../Tutorials/incompressible_flow/Inc_Combustion/1__premixed_hydrogen" premixed_hydrogen.cfg_file = "H2_burner.cfg" premixed_hydrogen.test_iter = 10 - premixed_hydrogen.test_vals = [-9.880667, -10.491791, -11.028989, -4.325192, -11.885386] + premixed_hydrogen.test_vals = [-8.851285, -9.756885, -11.037752, -4.321598, -11.891933] test_list.append(premixed_hydrogen) ### Compressible Flow diff --git a/TestCases/vandv.py b/TestCases/vandv.py index b99b08830e25..f7b197632ca4 100644 --- a/TestCases/vandv.py +++ b/TestCases/vandv.py @@ -111,8 +111,8 @@ def main(): sandiajet_sst.cfg_dir = "vandv/species_transport/sandia_jet" sandiajet_sst.cfg_file = "validation.cfg" sandiajet_sst.test_iter = 5 - sandiajet_sst.test_vals = [-17.176580, -13.874388, -15.527373, -12.642932, -10.076847, -15.743858, 5.000000, -2.659012, 5.000000, -5.009351, 5.000000, -3.986162, 0.000257, 0.000000, 0.000000, 0.000257, 4020.500000, 3919.900000, 49.151000, 51.435000] - sandiajet_sst.test_vals_aarch64 = [-17.185309, -13.876043, -15.450166, -12.642164, -10.089126, -15.735933, 5.000000, -2.777595, 5.000000, -4.998013, 5.000000, -4.018409, 0.000257, 0.000000, 0.000000, 0.000257, 4020.500000, 3919.900000, 49.151000, 51.435000] + sandiajet_sst.test_vals = [-8.271400, -6.305945, -6.123143, -5.634565, -1.687556, -7.869775, 5.000000, -1.527449, 5.000000, -4.053788, 5.000000, -2.303502, 0.000257, 0.000000, 0.000000, 0.000257, 4020.500000, 3919.900000, 49.151000, 51.436000] + sandiajet_sst.test_vals_aarch64 = [-8.271400, -6.305945, -6.123143, -5.634565, -1.687556, -7.869775, 5.000000, -1.527449, 5.000000, -4.053788, 5.000000, -2.303502, 0.000257, 0.000000, 0.000000, 0.000257, 4020.500000, 3919.900000, 49.151000, 51.436000] test_list.append(sandiajet_sst) ################# diff --git a/TestCases/wallfunctions/flatplate/incompressible_SA/turb_SA_flatplate.cfg b/TestCases/wallfunctions/flatplate/incompressible_SA/turb_SA_flatplate.cfg index 1e87b7d96418..37c298a40b05 100644 --- a/TestCases/wallfunctions/flatplate/incompressible_SA/turb_SA_flatplate.cfg +++ b/TestCases/wallfunctions/flatplate/incompressible_SA/turb_SA_flatplate.cfg @@ -93,7 +93,7 @@ CONV_CAUCHY_EPS= 1E-6 % MESH_FILENAME= ../mesh_flatplate_140x100.su2 MESH_FORMAT= SU2 -SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_TEMPERATURE, RMS_NU_TILDE, \ +SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_ENTHALPY, RMS_NU_TILDE, \ LINSOL_ITER, LINSOL_RESIDUAL, LIFT, DRAG) SCREEN_WRT_FREQ_INNER= 10 % diff --git a/TestCases/wallfunctions/flatplate/incompressible_SST/turb_SST_flatplate.cfg b/TestCases/wallfunctions/flatplate/incompressible_SST/turb_SST_flatplate.cfg index d93972b22d37..9080c3903c5c 100644 --- a/TestCases/wallfunctions/flatplate/incompressible_SST/turb_SST_flatplate.cfg +++ b/TestCases/wallfunctions/flatplate/incompressible_SST/turb_SST_flatplate.cfg @@ -91,7 +91,7 @@ CONV_CAUCHY_EPS= 1E-6 % MESH_FILENAME= ../mesh_flatplate_140x100.su2 MESH_FORMAT= SU2 -SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_TEMPERATURE, RMS_TKE, RMS_DISSIPATION, \ +SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_ENTHALPY, RMS_TKE, RMS_DISSIPATION, \ LINSOL_ITER, LINSOL_RESIDUAL, LIFT, DRAG, TOTAL_HEATFLUX) SCREEN_WRT_FREQ_INNER= 10 HISTORY_OUTPUT= (ITER, RMS_RES, AERO_COEFF, FLOW_COEFF)