|
[Sponsors] |
Quadratic Equation Coefficient Discrepancy in SU2 Code for Total Boundary Conditions |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 20, 2023, 03:09 |
Quadratic Equation Coefficient Discrepancy in SU2 Code for Total Boundary Conditions
|
#1 |
New Member
Kuan-Lin Chen
Join Date: Sep 2016
Location: Taiwan
Posts: 10
Rep Power: 10 |
Hi everyone ,
I'm currently trying to understand how the total boundary condition works, and I've been referring to the SU2 code (lines 6546 to 6641). https://github.com/su2code/SU2/blob/...46C15-L6546C15 However, I've noticed that the coefficient of the quadratic equation in the code appears to be incorrect. Here are the relevant equations for reference: Riemann invariant: R=2*c/(γ-1)+U so U=R-2*c/(γ-1) Stagnation sound speed: c_t^2=(γ-1)*(0.5*U^2 )+c^2 Where c is the sound speed, c_t is the stagnation sound speed, and U is the flow velocity. Code:
/*--- Total speed of sound ---*/ SoundSpeed_Total2 = Gamma_Minus_One*(H_Total - (Energy + Pressure/Density)+0.5*Velocity2) + SoundSpeed2; (c_t^2)/(γ-1 )=c^2/(γ-1)+0.5*U^2 →c_t^2=(γ-1)(0.5*U^2 )+c^2 →c_t^2=0.5*(γ-1)*[R-2*c/(γ-1)]^2+c^2 →c_t^2=0.5*(γ-1)*[R^2-4*R*c/(γ-1)+4*c^2/(γ-1)^2 ]+c^2 →c_t^2=0.5*(γ-1)*R^2-2*R*c+2*c^2/(γ-1)+c^2 Multiplying both sides by 0.5*(γ-1) gives: 0.5*(γ-1)*c_t^2=0.25*[(γ-1)^2]*R^2-(γ-1)*R*c+c^2+0.5*(γ-1)*c^2 [1+0.5*(γ-1)] *c^2-(γ-1)*R*c+0.25*R^2*(γ-1)^2-0.5*(γ-1)*c_t^2=0 The coefficients of the quadratic equation are: aa=1+0.5*(γ-1),bb=-(γ-1)*R, cc=0.25*R^2*(γ-1)^2- 0.5*c_t^2*(γ-1) However, the source code of SU2 shows that: aa=1+0.5*(γ-1),bb=-(γ-1)*R, cc=0.5*R^2*(γ-1)-2*c_t^2/(γ-1) Code:
/*--- Coefficients in the quadratic equation for the velocity ---*/ aa = 1.0 + 0.5*Gamma_Minus_One*alpha*alpha; bb = -1.0*Gamma_Minus_One*alpha*Riemann; cc = 0.5*Gamma_Minus_One*Riemann*Riemann -2.0*SoundSpeed_Total2/Gamma_Minus_One; Thank you. |
|
December 22, 2023, 14:22 |
|
#2 | |
New Member
Join Date: Feb 2022
Posts: 19
Rep Power: 4 |
Quote:
Do you know where the expression in brackets comes from? (H_Total - (Energy + Pressure/Density)+0.5*Velocity2) Why this additional term H_Total - (Energy + Pressure/Density)? I would really appreciate if you have some reference where I can get information about it. Thank you so much in advance!!! |
||
December 23, 2023, 10:07 |
|
#3 |
New Member
Kuan-Lin Chen
Join Date: Sep 2016
Location: Taiwan
Posts: 10
Rep Power: 10 |
Hi Christopher_Morales,
I am uncertain about the inclusion of H_Total - (Energy + Pressure/Density) within the brackets, too. However, upon reviewing lines 6571 and 6573, it appears that H_Total - (Energy + Pressure/Density) could be eliminated. Therefore, in my derivation process, I chose to omit this term as it seemed inconsistent with the overall expression. I apologize if this leads to any disappointment or confusion. If you have any insights or suggestions regarding this specific term, I would greatly appreciate your input. |
|
December 25, 2023, 13:58 |
|
#4 |
Senior Member
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13 |
Cristopher I think the answer to that is in the SUmb implementation
https://github.com/sumbcode/sumb/blo...onicInflow.f90 The comment in line 161 mentions that this version is valid for variable Cp using a linearization around the internal state. |
|
December 25, 2023, 14:04 |
|
#5 |
Senior Member
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13 |
Kuan the Riemann invariant extrapolated from the interior is the negative one, so 2 * c / (gamma - 1) - Vn.
Note that Vn is the normal velocity, in the code the minus sign comes from the unit normal pointing outward. |
|
December 26, 2023, 02:05 |
|
#6 | |
New Member
Kuan-Lin Chen
Join Date: Sep 2016
Location: Taiwan
Posts: 10
Rep Power: 10 |
Quote:
Thank you for your response. (1) i modfied the Riemann invarient to R=2*c/(γ-1)-U but the coefficients of the quadratic equation still differ from the SU2 code. The derivation process is as follows: (c_t^2)/(γ-1 )=c^2/(γ-1)+0.5*U^2 →c_t^2=(γ-1)(0.5*U^2 )+c^2 →c_t^2=0.5*(γ-1)*[2*c/(γ-1)-R]^2+c^2 →c_t^2=0.5*(γ-1)*[4*c^2/(γ-1)^2-4*R*c/(γ-1)+R^2]+c^2 →c_t^2=0.5*(γ-1)*R^2-2*R*c+2*c^2/(γ-1)+c^2 Multiplying both sides by 0.5*(γ-1) gives: 0.5*(γ-1)*c_t^2=0.25*[(γ-1)^2]*R^2-(γ-1)*R*c+c^2+0.5*(γ-1)*c^2 [1+0.5*(γ-1)]*c^2-(γ-1)*R*c+0.25*R^2*(γ-1)^2-0.5*(γ-1)*c_t^2=0 The coefficients of the quadratic equation are: aa=1+0.5*(γ-1),bb=-(γ-1)*R, cc=0.25*R^2*(γ-1)^2- 0.5*c_t^2*(γ-1) The source code of SU2 shows that: aa=1+0.5*(γ-1),bb=-(γ-1)*R, cc=0.5*R^2*(γ-1)-2*c_t^2/(γ-1) This likely involves specific considerations in the SU2 code that might not be apparent in the derivation. Could you please offer a more detailed explanation? (2) Regarding the additional term H_Total - (Energy + Pressure/Density), it seems to be used for calculating the total sound speed for variable cp,as indicated by the source code you provided. However, I'm not entirely clear on how it is developed in the code and combined with the Riemann invariant. I would appreciate a more detailed explanation of this part. Thank you for your assistance. |
||
December 26, 2023, 11:26 |
|
#7 |
Senior Member
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13 |
We're solving for U in the code, not the speed of sound.
I don't have more details on the total speed of sound formulation. |
|
December 26, 2023, 23:18 |
|
#8 | |
New Member
Kuan-Lin Chen
Join Date: Sep 2016
Location: Taiwan
Posts: 10
Rep Power: 10 |
Quote:
Thank you for your correction. However, I'm still unable to find references or equations that directly solve velocity U using the Riemann invariant. The methods I've come across, such as FUN3D, utilize the Riemann invariant to solve for sound speed and subsequently obtain velocity (see equations 36-45 in this reference https://fun3d.larc.nasa.gov/papers/N...011-217181.pdf). I'm curious about how the coefficients of the quadratic equation for velocity are developed in SU2. Could you provide more insights into this process? Thank you for your assistance. |
||
December 27, 2023, 00:43 |
|
#9 |
Senior Member
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13 |
Same thing you've done but replacing c instead of replacing U I suppose.
One book mentions that solving for c may be better for low Mach numbers. |
|
December 27, 2023, 01:35 |
|
#10 |
New Member
Kuan-Lin Chen
Join Date: Sep 2016
Location: Taiwan
Posts: 10
Rep Power: 10 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Centrifugal fan | j0hnny | CFX | 13 | October 1, 2019 13:55 |
Domain Reference Pressure and mass flow inlet boundary | AdidaKK | CFX | 75 | August 20, 2018 05:37 |
My radial inflow turbine | Abo Anas | CFX | 27 | May 11, 2018 01:44 |
Basic Nozzle-Expander Design | karmavatar | CFX | 20 | March 20, 2016 08:44 |
Difficulty In Setting Boundary Conditions | Moinul Haque | CFX | 4 | November 25, 2014 17:30 |