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

Help regarding 1D compressible flow (Sod Shock tube)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 25, 2022, 06:27
Default
  #21
New Member
 
Poly T
Join Date: May 2022
Posts: 24
Rep Power: 3
poly_tec is an unknown quantity at this point
the only correct response to „i need your codes“ is: I need your money.
poly_tec is offline   Reply With Quote

Old   August 25, 2022, 11:04
Default
  #22
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
how much money🤔
javeria is offline   Reply With Quote

Old   August 25, 2022, 17:26
Default
  #23
New Member
 
Poly T
Join Date: May 2022
Posts: 24
Rep Power: 3
poly_tec is an unknown quantity at this point
I hope you realize this was a joke. Is this a homework problem?
poly_tec is offline   Reply With Quote

Old   August 25, 2022, 17:53
Default
  #24
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
no this is not my homework and I ask for help..
javeria is offline   Reply With Quote

Old   August 25, 2022, 18:00
Default
  #25
New Member
 
Poly T
Join Date: May 2022
Posts: 24
Rep Power: 3
poly_tec is an unknown quantity at this point
well, post your code and we can have a look
poly_tec is offline   Reply With Quote

Old   August 25, 2022, 18:02
Default
  #26
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
I haven't any idea about high resolution scheme that how I do coding for it in MATLAB
javeria is offline   Reply With Quote

Old   August 25, 2022, 18:06
Default
  #27
New Member
 
Poly T
Join Date: May 2022
Posts: 24
Rep Power: 3
poly_tec is an unknown quantity at this point
Then why do you want to code it ? First read up on the theory.
poly_tec is offline   Reply With Quote

Old   August 25, 2022, 18:07
Default
  #28
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
I read the literature but my coding is not too much strong
javeria is offline   Reply With Quote

Old   August 26, 2022, 01:19
Default
  #29
New Member
 
Poly T
Join Date: May 2022
Posts: 24
Rep Power: 3
poly_tec is an unknown quantity at this point
then you should start with a simpler task. Show your work and we might help, but do not expect us to do the work for you.
poly_tec is offline   Reply With Quote

Old   August 26, 2022, 17:21
Default
  #30
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
ok sure I will share my code
javeria is offline   Reply With Quote

Old   August 27, 2022, 07:42
Default
  #31
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
clear all;
close all;
clc;


R=287;
%Cv=717;
gamma=1.4;
rhol=1;
Ul=0;
Pl=100000;

rhor=0.125;
Ur=0;
Pr=10000;

c=50;
delx=20/c;
delt=.0004278;
lambda=.001069;


for i=1:1:c+1
x(i)=-10+(i-1)*delx;
end

for i=1:1:c+1

if (x(i)<0)

rho(1,i)=rhol;
u(1,i)=Ul;
p(1,i)=Pl;

else
rho(1,i)=rhor;
u(1,i)=Ur;
p(1,i)=Pr;
end
end

for i=1:1:c+1

mom(1,i)=rho(1,i)*u(1,i);
%t(1,i)=p(1,i)/(rho(1,i)*R);
e(1,i)=p(1,i)/((gamma-1)*rho(1,i));
energ(1,i)=(e(1,i)+.5*u(1,i)^2);
energrho(1,i)=energ(1,i)*rho(1,i);
end

for n=2:1:30

for i=2:1:c

rho(n,i)= .5*(rho(n-1,i-1)+ rho(n-1,i+1))-.5*lambda*(u(n-1,i+1)*rho(n-1,i+1)-u(n-1,i-1)*rho(n-1,i-1));
mom(n,i)= .5*(mom(n-1,i-1)+ mom(n-1,i+1))-.5*lambda*(u(n-1,i+1)*mom(n-1,i+1)+p(n-1,i+1)-p(n-1,i-1)-u(n-1,i-1)*mom(n-1,i-1));
energrho(n,i)= .5*(energrho(n-1,i-1)+energrho(n-1,i+1))-.5*lambda*((u(n-1,i+1)*energrho(n-1,i+1)+p(n-1,i+1)*u(n-1,i+1) - u(n-1,i-1)*energrho(n-1,i-1)+p(n-1,i-1)*u(n-1,i-1)));

energ(n,i)=energrho(n,i)/rho(n,i);
u(n,i)=mom(n,i)/rho(n,i);
e(n,i)=energ(n,i)-.5*u(n,i)^2;
%t(n,i)=e(n,i)/Cv;
p(n,i)=(gamma-1)*rho(n,i)*e(n,i);

end


rho(n,1)=rho(1,1);
rho(n,c+1)=rho(1,c+1);
mom(n,1)=mom(1,1);
mom(n,c+1)=mom(1,c+1);
e(n,1)=e(1,1);
e(n,c+1)=e(1,c+1);
%t(n,1)=t(n,2);
%t(n,1)=e(n,1)/Cv;
%t(n,c+1)=t(n,c);
%t(n,c+1)=e(n,c+1)/Cv;
p(n,1)=p(1,1);
%p(n,1)=rho(n,1)*R*t(n,1);
p(n,c+1)=p(1,c+1);
%p(n,c+1)=rho(n,c+1)*R*t(n,c+1);
u(n,1)=u(1,1);
%u(n,1)=mom(n,1)/rho(n,1);
u(n,c+1)=u(1,c+1);
%u(n,c+1)=mom(n,c+1)/rho(n,c+1);

end



t=plot(x,p(30,,'or');
axis([-10 10 0 100000])


t=plot(x,u(30,,'or');
axis([-10 10 -150 450])

t=plot(x,rho(25,,'or');
axis([-10 10 0 1.1])
javeria is offline   Reply With Quote

Old   August 27, 2022, 07:43
Default
  #32
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
i need the pressure, velocity and density plot but in this code not generate
javeria is offline   Reply With Quote

Old   August 27, 2022, 07:57
Default
  #33
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
and second this one
Attached Files
File Type: docx clear all.docx (33.4 KB, 1 views)
javeria is offline   Reply With Quote

Old   August 27, 2022, 08:54
Default
  #34
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
have a look at:
http://www.clawpack.org/



http://www.clawpack.org/riemann_book...V_compare.html
FMDenaro is offline   Reply With Quote

Old   August 27, 2022, 16:25
Default
  #35
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
i do not understand the python.. matlab please
javeria is offline   Reply With Quote

Old   August 27, 2022, 16:36
Default
  #36
New Member
 
Poly T
Join Date: May 2022
Posts: 24
Rep Power: 3
poly_tec is an unknown quantity at this point
Honestly, dude, if you cannot figure out how to translate python into matlab or vice versa, you should stop trying to write cfd codes. No one here will spoon feed you. Stop this or put serious work into it. You come across as a whiny high school kid who wants others to do the homework for him. If you have a direct question, ask - but stop trying to leech.
poly_tec is offline   Reply With Quote

Old   August 29, 2022, 05:47
Default
  #37
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
I just asked for help so why you mind it. I am stuck I used maacormack, laxwendroff and roe's scheme. Now i need some other scheme to compare the results and submit my thesis. If you are not helping me ignore.
javeria is offline   Reply With Quote

Old   August 29, 2022, 05:49
Default
  #38
New Member
 
Poly T
Join Date: May 2022
Posts: 24
Rep Power: 3
poly_tec is an unknown quantity at this point
I mind because you are not asking for help. You are asking „solve my problems for me because I am too lazy to even formulate a meaningful question“.
poly_tec is offline   Reply With Quote

Old   August 29, 2022, 05:52
Default
  #39
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
I asked to share someone matlab codes then i will make changes in it according to my problem
javeria is offline   Reply With Quote

Old   August 29, 2022, 05:57
Default
  #40
New Member
 
javeria
Join Date: Aug 2022
Posts: 21
Rep Power: 4
javeria is on a distinguished road
so please if someone can help me let me know. Because i will have submit my thesis also by tomorrow
javeria is offline   Reply With Quote

Reply


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
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 07:40
Compressible Flow Pressure Outlet Back Flow okstatecheme OpenFOAM Running, Solving & CFD 1 March 21, 2018 09:11
rhoCentralFoam not reflecting shock in Shock Tube? Astaria OpenFOAM Running, Solving & CFD 5 March 4, 2012 04:07
compressible flow maria teresa FLUENT 1 September 7, 2007 17:58
Inviscid Drag at subsonic, subcritical Mach # Axel Rohde Main CFD Forum 1 November 19, 2001 13:19


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