MCEN90008 Fluid Dynamics 2024 Unit 2 - Compressible flow assignment - Part IIR

超音速机翼设计流体动力学作业要求
部署运行你感兴趣的模型镜像

Java Python MCEN90008 Fluid Dynamics 2024

Unit 2 - Compressible flow assignment - Part II

Supersonic wing design

Instructions:

• Assignment is due 11:59 pm Sunday 20th October 2024

• This assignment should be done in groups of 2 students. Both students in the group will get the same mark for this assignment. If you choose to do the assignment alone, no concession will be given (your assignment will be marked the same as an assignment done by two students). Groups of three are not permitted.

• Please choose your group partner carefully.

• Signs of collusion between groups in the submitted report will be treated as plagarism

• Only hand in one assignment per group.

• Question 1 (shock-expansion theory) is quite tedious - and well suited to computational solution. I suggest that you write a Matlab code, since this will save you time later for question 4 & 6. You may use the tabulated data and graphical information provided at the back if you prefer to get some practise using tables (as you would in the exam).

• You should at every step show which equations and assumptions you are using to arrive at results.

• The airfoil that you are asked to analyze is very thin, thus the flow deflec tions are relatively small (and therefore the shocks relatively weak). Your solutions will be more accurate if you use the functions provided to solve the various equations. If you do use the tabulated data given at the back of this assignment (not really recommended), it is important where possible that you adequately interpolate between values in tables to maintain accuracy. If your solutions require tabulated data beyond the range provided here, full tables are available under the resources tab of LMS

• Where you are asked to include graphs, you must adequately label key values and include all axis labels etc to receive full marks.

• Append your Matlab codes to your submissions.

Supersonic wing design

Figure 1: Supersonic airfoil cross-section

A new supersonic passenger aircraft with a cruise Mach number M = 2.2 is designed to employ the above wing profile.

1. Use shock-expansion theory to calculate the Mach number and the ratio p/p∞ in all six flow regions labeled 1 − 6 on the figure, for angle-of-attack α = 4. Fill out the first two columns of table 1. Show all workings in your report for this angle of attack and also include your codes. For the latter parts of this question, it is strongly suggested that you write a Matlab code to compute these. (12 Marks)

Table 1: Tabulated results for questions 1 and 2

2. Now also compute the Mach number and the ratio p/p∞ in all six flow regions using Ackeret’s linearized Mach-line approximation (which dropped out from Ackeret’s clever Taylor’s series expansion that we covered in lectures)

and

where η is the angle that each facet makes with the oncoming flow, and again ± and ∓ refer to the upper and lower aerodynamic surface (upper sign is upper surface, lower sign is lower surface). M∞, ρ∞ and V∞ are the conditions of the oncoming flow (upstream of the airfoil) and δp and δM are changes about these reference conditions. Fill the answers for regions 1 − 6 in the last two columns in Table 1. Show workings in your report for facets 2 and 5 and also include your codes. (6 Marks)

3. Hence calculate the lift and drag coefficient at this angle-of-attack for the two different meth-ods (shock-expansion, linearized Mach-Line) for the results tabulated in Table 1 and also compare these with the solution from Ackeret’s approximate solutions for CD MCEN90008 Fluid Dynamics 2024 Unit 2 - Compressible flow assignment - Part IIR and CL given below. Fill answers n the Table 2 shown below. Show workings in your report for the shock-expansion calculation of CL and CD and also the calculation using Ackeret theory given in equations (1) and (2). It will be easier for subsequent questions (4 & 6) if you write a Matlab code for the shock-expansion method that modifies your code from question 1 to return CL and CD for a given angle-of-attack α.

Table 2: Tabulated results for question 3

(12 Marks)

4. Consider an aircraft of mass m in straight and level flight using the wing cross-section shown in figure 1. Use your shock-expansion code to seek a numerical solution for the angle-of-attack α that will give the smallest drag due to the wing. (5 Marks)

5. Compare this to the minimum angle predicted from Ackeret’s equations for CL and CD. Prove that the angle for the minimum drag is given by,

(6 Marks)

6. Plot mg/D against angle-of-attack α (for 0 < α < 8 ◦ ) for the shock-expansion and Ackeret solution, where m is the aircraft mass, D is the drag of the wing and g is acceleration due to gravity. Mark the minimum drag angles on this figure. Comment on the agreement / disagreement as a function of α. (2 Marks)

7. Comment on the advantages and disadvantages for an aircraft designer employing the mini-mum drag angle in cruise? (1 Marks)

θ-β-M relationship

Relationship between shock angle β and flow deflection angle θ for (top) several Mach numbers M = 1.2, 1.5, 2, 2.5, 3, 10, (bottom) zoomed view on inset with curves for M = 1.85 to 2.40 in steps of 0.01.

Rather than using the θ −β −M chart, it would be more accurate to make use of the Matlab script. file getbeta_betathetaM.m which solves the equation:

getbeta_betathetaM.m will return the shock angle β for a given θ and M. For example for an upstream Mach number M = 2 and a flow deflection of 5◦ ,

>>beta = getbeta_betathetaM(2,5)

>>beta = 34.3016

Normal shock relations

It will be more accurate to use the provided Matlab scripts to calculate the pressure and Mach number change across a normal shock. The function M2_nshock will return the downstream (normal component of) Mach Number for a given upstream (normal component of) Mach number. This script. solves the following relationship,

M2_nshock.m will return M2N for a given M1N . For example for an upstream Mach number M1N = 1.5,

>>M2 = M2_nshock(1.5)

>>M2 = 0.7011

For the pressure change across a normal shock, the Matlab script. p2_over_p1_nshock can be used, which uses the following relationship,

p2_over_p1_nshock will return p1/p2 for a given M1N . For example for an upstream Mach number M1N = 1.5,

>>p2onp1 = p2_over_p1_nshock(1.5)

>>p2onp1 = 2.4583

Prandtl-Meyer Relationship

It will be more accurate to use the provided Matlab scripts to calculate the Prandtl angle from the Mach number (and vice-verse). The function M_given_prandtl_angle will return the Mach Number for a given Prandtl angle. The function prandtl_angle_given_M will return the Prandtl angle ω for a given Mach number. These scripts solve the following relationship,

prandtl_angle_given_M will return ω for a given M. For example for an upstream Mach number M1 = 2,

>>omega = prandl_angle_given_M(2)

>>omega = 26.3798

M_given_prandtl_angle will return M for a given ω. For example for a Prandtl angle ω = 26.3798,

>>M = M_given_prandtl_angle(26         

您可能感兴趣的与本文相关的镜像

Stable-Diffusion-3.5

Stable-Diffusion-3.5

图片生成
Stable-Diffusion

Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

<think>好的,用户遇到了关于STM32 HRTIM寄存器配置的问题,具体是HRTIM1 sCommonRegs CR2 SWRST的代码错误。我需要先理解用户的问题背景,然后分析可能的原因,最后给出解决方法。 首先,HRTIM是STM32中的高分辨率定时器模块,其配置通常涉及直接操作寄存器或使用库函数。用户提到sCommonRegs CR2 SWRST,这可能是指结构体中的某个成员,比如HRTIM_COMMON->CR2.SWRST。常见的错误可能包括寄存器访问方式不正确、未遵循正确的配置顺序,或者硬件状态未正确处理。 根据用户提供的引用内容,特别是引用[1]提到的寄存器操作原则,比如状态标志的清除顺序和错误恢复步骤,这可能相关。例如,在I2C配置中需要按顺序清除标志位,类似的问题可能在HRTIM配置中出现。 接下来需要考虑可能的错误原因: 1. **寄存器访问权限问题**:HRTIM可能在复位状态下无法写入某些寄存器,需要先解除复位或正确初始化时钟。 2. **配置顺序错误**:配置HRTIM时,可能需要先设置某些参数再使能模块,或者在复位后未正确重新初始化。 3. **结构体或指针错误**:用户代码中的sCommonRegs可能未正确指向HRTIM_COMMON寄存器,导致访问错误地址。 4. **未清除状态标志**:类似于引用[2]中的ADDR标志需要读取SR1和SR2,HRTIM可能需要在操作前清除某些状态位。 5. **硬件依赖性未满足**:例如,未使能HRTIM的时钟,或者相关GPIO未正确配置。 修复方法可能包括: - 检查HRTIM的时钟使能,确保相关外设时钟已开启。 - 确认寄存器访问顺序,例如在复位后正确重新配置所有必要的寄存器。 - 使用正确的库函数或直接寄存器操作方式,确保结构体成员名称正确。 - 处理错误标志,必要时进行错误恢复流程,如复位外设并重新初始化。 需要验证用户代码中的具体写法,比如是否在调用SWRST后等待复位完成,或者是否在复位前停止了定时器。此外,参考STM32的参考手册或库例程,确认正确的配置步骤。</think>针对HRTIM1的sCommonRegs CR2 SWRST寄存器配置错误,以下是关键分析及修复步骤: ### 错误原因分析 1. **寄存器访问顺序错误** HRTIM外设的软复位操作需要严格的时序控制。若在未停止定时器的情况下直接触发SWRST,可能引发总线错误[^1]。 2. **结构体成员映射错误** `sCommonRegs`结构体可能未正确映射到HRTIM_COMMON寄存器组,导致对CR2寄存器的写入操作失效。例如: ```c // 错误写法:未正确对齐寄存器组 HRTIM_COMMON->CR2 |= HRTIM_CR2_SWRST; ``` 3. **硬件状态未同步** 触发软复位后未等待复位完成就继续配置,导致寄存器写入冲突。根据STM32手册要求,SWRST操作需要至少3个HRTIM时钟周期才能完成[^2]。 ### 修复步骤 1. **停止所有主定时器** ```c HRTIM1->sMasterRegs.MCR |= HRTIM_MCR_MCEN_STOP; // 停止主控定时器 while(HRTIM1->sMasterRegs.MCR & HRTIM_MCR_MCEN_STOP); // 等待生效 ``` 2. **正确执行软复位** ```c // 使用标准外设库写法 HRTIM_CommonRestoreResetState(&hhrtim1); // 通过库函数触发复位 // 或直接寄存器操作 HRTIM_COMMON->CR2 |= HRTIM_CR2_SWRST; // 置位复位位 while(HRTIM_COMMON->CR2 & HRTIM_CR2_SWRST);// 等待复位完成[^3] ``` 3. **重新初始化配置** ```c // 必须按手册要求顺序配置 HRTIM_COMMON->CR1 = 0x00000000; // 先清除控制寄存器 HRTIM_COMMON->CR2 = HRTIM_CR2_PREEN; // 配置预载使能 // 配置时钟分频等参数... ``` ### 验证要点 1. 检查APB总线时钟配置是否与HRTIM时钟域匹配 2. 使用调试器查看HRTIM_CR2寄存器实际写入值 3. 确保在触发复位前所有DMA传输已停止
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值