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

Initialization of velocity/mass flux

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 17, 2019, 17:21
Default Initialization of velocity/mass flux
  #1
New Member
 
Koustubh Bhagat
Join Date: Mar 2019
Posts: 2
Rep Power: 0
krb_1306 is on a distinguished road
Hello,

I have just started writing small codes to simulate CFD problems just to get a gist of it. I have a question. Why should velocity be initialized such that continuity equation is solved? I mean it does sound obvious that continuity equation should be satisfied but what if I don't initialize velocity to so that continuity equation is satisfied? I tried doing it. The solution did converge but I got different results for both the cases. I have attached the problem and the MATLAB code I wrote. I haven't used the initialization values they have suggested though.
Thank you in advance.

My MATLAB code:

u=[1 3];
p2c=10;
p2=0;
epsilon=0.001;
error=1;
ma=u(1)*3;
mb=u(2)*1;
e=[10 10]
while abs(p2c)>0.001
old=u;
ma=u(1)*3;
mb=u(2)*1;
u(1)=(3/ma)*(28-p2);
u(2)=ma/mb*u(1) + p2/mb;
u
p2c=(3*u(1) - u(2))/((1/mb)+(9/ma));
p2c
u(1)=u(1) -3*p2c/ma;
u(2)=u(2) + p2c/mb;
p2=p2 + p2c;
u
end
Attached Images
File Type: jpg 2.JPG (14.6 KB, 5 views)
File Type: jpg 1.JPG (34.4 KB, 8 views)
krb_1306 is offline   Reply With Quote

 


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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 07:30
My radial inflow turbine Abo Anas CFX 27 May 11, 2018 01:44
How to use "translation" in solidBodyMotionFunction in OpenFOAM rupesh_w OpenFOAM Running, Solving & CFD 5 August 16, 2016 04:27
Udf for moving heat flux in 2D cylindrical geometry devia21 Fluent UDF and Scheme Programming 0 April 20, 2015 00:27
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28


All times are GMT -4. The time now is 10:42.