CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Quasi 1D Nozzle Shock Capturing MacCormack Method Problems (https://www.cfd-online.com/Forums/main/171952-quasi-1d-nozzle-shock-capturing-maccormack-method-problems.html)

matt1234 May 20, 2016 12:55

Quasi 1D Nozzle Shock Capturing MacCormack Method Problems
 
Hi I am new to CFD, and I have been using the introductory book by Anderson.

It has multiple cases for a Quasi 1D Nozzle, and I am completely stuck on the Shock Capturing Case (7.6).

It is done using a MacCormack method with added artificial viscosity in conservation form and a constant exit pressure ratio of 0.6784.

I have tried as exactly presented in the book (I think) as well as have tried many other approaches to see if I could fix it. No matter what, my code diverges after about 25 time steps.

Has anybody successfully solved this code?
If so, can you please show me the code?
I would prefer MATLAB, but any computing language is fine.

This is driving me crazy!

Or, if anybody as another code that solves this problem (not necessarily MacCormack method) please provide it to me.

Please post here or feel free to email it to me: mbyoung18@hotmail.com

Thank you so much!

LUQILIN May 20, 2016 21:16

General finite volume scheme could catch the shock but with numerical oscillations at discontinuities. Try this first. Just ignore the shock and see what you can get. You can e-mail to me if you have further questions: luqilin@hrbeu.edu.cn.

Ramkumar21194 May 22, 2016 08:30

I have encountered same problem
 
1 Attachment(s)
i have done same problem in matlab using same Mccormack technique as described in Ch7. my problem is, i encounter -ve temperature in about 100th iteration step. i dont know why, could you please help me with this?

i have solved the rest of the problems in CH7. this one is driving me crazy

i think the problem is in extrapolation in outlet.

please help me with this.

here is my code

Ramkumar21194 May 22, 2016 08:40

upload your matlab code matt, i wanna take a look at it

Haider58 July 7, 2017 04:04

Hay ramKumar..

Its been a year now. Have you been able to resollve bug in your code. Can you please share it.

Thanks

ardalankhalili July 19, 2017 01:38

hey rumkummar
im facing the same problem so i was wondering if you resolved this problem yet? my solution diverges after about 100 iterations and the results are not anywhere near acceptable... i think my problem is at subsonic outflow boundaries that need to float (as the anderson says).

please let me know if you had any progress.

thanks.

pritam.gole October 23, 2019 04:58

Non dimesionalised length
 
If length in the code is considered as 3, then x' = x/L can't go from 0-3. It should vary from 0 to 1. But, in all the code it is considered as 0 to 3. Please help me out to understand it.

CrushedToucan96 March 6, 2020 07:47

Shock Capturing(MacCormack) - John D Anderson
 
Quote:

Originally Posted by matt1234 (Post 600999)
Hi I am new to CFD, and I have been using the introductory book by Anderson.

It has multiple cases for a Quasi 1D Nozzle, and I am completely stuck on the Shock Capturing Case (7.6).

It is done using a MacCormack method with added artificial viscosity in conservation form and a constant exit pressure ratio of 0.6784.

I have tried as exactly presented in the book (I think) as well as have tried many other approaches to see if I could fix it. No matter what, my code diverges after about 25 time steps.

Has anybody successfully solved this code?
If so, can you please show me the code?
I would prefer MATLAB, but any computing language is fine.

This is driving me crazy!

Or, if anybody as another code that solves this problem (not necessarily MacCormack method) please provide it to me.

Please post here or feel free to email it to me: mbyoung18@hotmail.com

Thank you so much!


Im' facing just about the same issue as mentioned above. Temperature goes negative after 25 timesteps causing dt (Adaptive) and Mach number go complex. Isnt there a solution to this? Anderson hasnt done any sort of calculations for validation

CrushedToucan96 March 8, 2020 09:45

Shock caputring
 
4 Attachment(s)
Quote:

Originally Posted by Ramkumar21194 (Post 601190)
i have done same problem in matlab using same Mccormack technique as described in Ch7. my problem is, i encounter -ve temperature in about 100th iteration step. i dont know why, could you please help me with this?

i have solved the rest of the problems in CH7. this one is driving me crazy

i think the problem is in extrapolation in outlet.

please help me with this.

here is my code

Hey i went through your code and whilst all looked fine there were some portions that i quite wasnt able to wrap my head around. One of those things were your steady state static pressure plot [1600 timesteps] for no artificial viscosity. Although there wasnt any smoothening which is expected the oscillations seems to be too low it almost quite resembled the analytical results. I have attached the plot i got for the same conditions and it quite matches with the book [Ref Shock.jpg & Shock_Anderson.jpg] . Another thing that i found out was your J2 formulation where you seem to have opted to use the bigger formula [Ref J2Formulation.jpg] , which conforms to the 'pure' form of the flux terms, There seems to be a typo in the log(dA/dx) part which which should have been forward differenced for the predictor part and rearward for the corrector part. [Ref J2Formulation_typo.jpg] . Making this change forces us to update J2 only in the inner nodes [ where i = 2:n-1] . I still get the negative temperature error after correcting this but thought you should know about this. Let me know if you've found a solution to this.


All times are GMT -4. The time now is 23:19.