Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F66875195
InitNozzle.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jun 18, 15:13
Size
1 KB
Mime Type
text/x-c
Expires
Thu, Jun 20, 15:13 (2 d)
Engine
blob
Format
Raw Data
Handle
18309273
Attached To
R3721 ConSol
InitNozzle.cpp
View Options
//
// Created by Fabian Moenkeberg on 2019-12-18.
//
#include "InitNozzle.hpp"
std
::
vector
<
double
>
initNozzle
::
F
(
std
::
vector
<
double
>
x
){
std
::
vector
<
double
>
ret
(
4
,
0
);
// double r2 = pow(x[0]-xc[0],2) + pow(x[1]-xc[1],2);
// ret[0] = pow(1-beta*beta*(gamma-1)*exp(1-r2)/(8*gamma*M_PI*M_PI),1/(gamma-1));
// ret[1] = (M*cos(alpha)-beta*(x[1]-xc[1])*exp((1-r2)*0.5)*0.5/M_PI)*ret[0];
// ret[2] = (M*sin(alpha)+beta*(x[0]-xc[0])*exp((1-r2)*0.5)*0.5/M_PI)*ret[0];
// ret[3] = pow(ret[0],gamma)/(gamma-1)+0.5*(ret[1]*ret[1]+ret[2]*ret[2])/ret[0];
// double r_in = 1;
// double u1_in = std::sqrt(gamma)*M;
// double u2_in =0;
// double p_in = 1;
std
::
vector
<
double
>
U_in
(
4
);
std
::
vector
<
double
>
U_out
(
4
);
U_in
.
resize
(
4
);
U_out
.
resize
(
4
);
double
T_in
=
300
;
double
NPR
=
2.1
;
double
m_in
=
0.7
;
double
p_in
=
101325
*
NPR
;
double
r_in
=
p_in
/
287.14
/
T_in
;
double
u1_in
=
m_in
/
r_in
/
0.116
;
u1_in
=
0
;
double
u2_in
=
0
;
double
E_in
=
p_in
/
(
gamma
-
1
)
+
0.5
*
(
u1_in
*
u1_in
+
u2_in
*
u2_in
)
*
r_in
;
double
T_out
=
300
;
double
u1_out
=
0
;
double
u2_out
=
0
;
double
p_out
=
101325
;
double
r_out
=
1.3
;
r_out
=
p_out
/
287.14
/
T_out
;
double
E_out
=
p_out
/
(
gamma
-
1
)
+
0.5
*
(
u1_out
*
u1_out
+
u2_out
*
u2_out
)
*
r_out
;
U_in
=
{
r_in
,
r_in
*
u1_in
,
r_in
*
u2_in
,
E_in
};
U_out
=
{
r_out
,
r_out
*
u1_out
,
r_out
*
u2_out
,
E_out
};
// if (false){
// if (true){
if
(
x
[
0
]
<
110
&&
x
[
1
]
<
40
){
ret
[
0
]
=
r_in
;
ret
[
1
]
=
u1_in
*
r_in
;
ret
[
2
]
=
u2_in
*
r_in
;
ret
[
3
]
=
E_in
;
}
else
{
ret
[
0
]
=
r_out
;
ret
[
1
]
=
u1_out
*
r_out
;
ret
[
2
]
=
u2_out
*
r_out
;
ret
[
3
]
=
E_out
;
}
return
ret
;
}
Event Timeline
Log In to Comment