CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Struggles (in Python) developing MacCormack Scheme for 1D shock tube

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 10, 2021, 19:40
Default Struggles (in Python) developing MacCormack Scheme for 1D shock tube
  #1
New Member
 
Von
Join Date: Dec 2017
Posts: 3
Rep Power: 8
Sirvonny is on a distinguished road
How is everyone doing? I am having issues (through Python) developing the MacCormack Scheme for a 1D shock tube problem. What was given is the vector Q = [\rho, \rho*u, \rho*e]^T where the rho is density, u is velocity and e is total energy. Also known as conservative variables. The flux vector is
F = [\rho*u, (\rho*u)**2 + p , \rho*u*H]^T (T means transpose). H is total enthalpy and p is pressure. The problem in question is the "sod problem", so the initial conditions are known.

The code is as followed: (You can ignore the first if statement and the first function since we are just calling the sod initial conditions there). Thanks!

Last edited by Sirvonny; October 10, 2021 at 19:43. Reason: python formatting bad
Sirvonny is offline   Reply With Quote

Old   October 10, 2021, 19:46
Default Had to reformat the code
  #2
New Member
 
Von
Join Date: Dec 2017
Posts: 3
Rep Power: 8
Sirvonny is on a distinguished road
Heres the code in .txt format

Please ignore the first if statement and the first function. It is just calling for the initial conditions of the sod problem.
Attached Files
File Type: txt project_p1_test.txt (4.6 KB, 19 views)
Sirvonny is offline   Reply With Quote

Reply

Tags
shock tube


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
lax friedrich scheme for shock tube problem. manukamin Main CFD Forum 3 March 22, 2016 01:02
Lax-wendroff scheme for Shock tube problem. manukamin Main CFD Forum 1 November 26, 2011 14:10
ENO Scheme in a Shock tube problem Shiv Main CFD Forum 4 January 29, 2007 15:31
Shock tube source code sencal Main CFD Forum 1 December 10, 2000 03:27
Roe Scheme; Shock Boundary layer Interaction Mohammad Kermani Main CFD Forum 5 December 20, 1999 15:44


All times are GMT -4. The time now is 21:08.