1 function p = compute_pressure(model, gradx, grady)
3 %
function, computing the pressure according to bernoulli equation on every
5 %
this function is adapted to the porsche_model
9 % gradx : x-vector of the gradient of the solution of the PDE (physically
10 %
this is the x-coordinate of the velocity-field in every point
12 % grady : y-vector of the gradient of the solution of the PDE (physically
13 %
this is the x-coordinate of the velocity-field in every point
16 % needed fields of model:
17 % model.speed : defining the speed of the car, that means the speed of the
18 % air on the left boundary
21 % p: vector with the pressure according to bernoulli equation
25 p_in = 101325; % standard pressure in pascal = kg/(m*s²) = N/m2
26 rho = 1.2041; % airdensity in kg/m3
27 u_in_sqr = model.speed^2 * 3.6^2; % model.speed is
28 % in km/h, so conversion to m/s2 is needed
29 abs_vel_sqr = (gradx.^2 + grady.^2) * 3.6^2;
30 % absolute value of velocity square
for every point in m/s2
31 p = (p_in + 0.5*rho * (u_in_sqr - abs_vel_sqr)); % pressure p in pascal
32 p = p*1e-5; %pressure p in bar