Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120479540
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
Fri, Jul 4, 16:21
Size
1 KB
Mime Type
text/x-c
Expires
Sun, Jul 6, 16:21 (2 d)
Engine
blob
Format
Raw Data
Handle
27194689
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;
gamma = 1.4;
std::vector<double> U_in(4);
std::vector<double> U_out(4);
U_in.resize(4);
U_out.resize(4);
double r_in = 5.8;
double u1_in = 77*r_in;
double u2_in =0;
double p_in = 101325*13.5;
double E_in = p_in/(gamma - 1) + 0.5*(u1_in*u1_in+u2_in*u2_in)*r_in;
double r_out = 1.3;
double u1_out = 197;
double u2_out =0;
double p_out = 101325;
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 (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