-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathramc2_sim.m
72 lines (60 loc) · 2.54 KB
/
ramc2_sim.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% RAM C-II Fall 2024 %%%%
%%%% Code for Writing .geo File %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
clear all
%% RAM C-II geometry (2D)
% Default values-----------------------------------------------------------
r_w = 15.24e-2; %(m) Domain Nose radius
theta_w = 9*pi/180; %(rad) Wall Semi-Cone angle
L = 129.54e-2; %(m) Length
r_d = 4*r_w; %(m) Domain Nose radius
theta_d = 4*theta_w; %(rad) Domain Semi-Cone angle
L2 = L + r_d/2; %(m) Domain length
% ---------------------------------------------------------------------
% Create class object with default parameters
ramc2data = ramc2dataclass();
meshdata = ramc2meshdataclass();
% Write .geo file
filename = 'ramc2struc.geo';
[A] = d2gfile_ramc2(ramc2data,meshdata,filename);
%% Code to obtain y value for RAE 2822 airfoil trial case
% Freestream conditions/Inputs definition
z = 0e+3; % (m) Sea-level conditions
% p = 19.73; % (Pa)
% T = 254; % (K)
FTd = FTdclass(z);
M = 1.2;
FV = FVclass('M',M);
[props] = thermoprops(FTd,'alt',FV,'M');
Re = M*props.a*L/props.nu;
%% Meshing
% Curve lengths------------------------------------------------------------
d1 = r_w*(pi/2-theta_w); %(m) Wall nose radius
d2 = r_d*(pi/2-theta_d); %(m) Domain nose radius
d3 = r_d/2; %(m) Farfield from wall at nose
d4 = norm(A(5,:)-A(6,:),2); %(m) Domain cone length
d5 = norm(A(6,:)-A(3,:),2); %(m) Domain outlet length
d6 = norm(A(3,:)-A(2,:),2); %(m) Wall cone length
% Elements
nnose = 400; % Number of elements on nose
rnose = 1; % Progression
ncone = 800; % Number of elements on domain nose
rcone = 0.4; % Bump
nwd = 1600; % No. of elements between wall and domain
rwd = 1.008; % Progression
% % Element sizes
ewnose = d1/nnose; % Size on nose
ewcone_avg = d6/ncone; % Size on domain nose
eymin = d3*(1-rwd)/(1-rwd^nwd);
eymax = eymin*rwd^(nwd-1);
% Update meshdata with the mesh refinement parameters from N_r3
meshdata = ramc2meshdataclass(nnose,rnose,ncone,rcone,nwd,rwd);
%% Write file
[A] = d2gfile_ramc2(ramc2data,meshdata,filename);
%% Y+ calculation
var_y = 1; % Calculate yplus for existing y value
y = eymin;
yplus = 0;
[y,yplus,cf,tau_w] = wallyp(props,M,L,var_y,y,yplus);