Commit aa096659 authored by Wander van der Wal's avatar Wander van der Wal
Browse files

Proper density now working and fixed the initialize velocity

parent ba096168
......@@ -51,4 +51,15 @@ def InitializeVelocity(v,D,L,n,T):
U=math.sqrt(U**2-up[m]**2)
up[0]=U
v[0,:,p]=up
return(v)
def InitializeVelocity2(v,D,L,n,T):
for p in range (n):
U=np.random.normal(0,math.sqrt(T),None)
the=np.random.uniform(0,np.pi)
phi=np.random.uniform(0,np.pi*2)
up=np.zeros([D],dtype=float)
up[0]=U*np.sin(the)*np.cos(phi)
up[1]=U*np.sin(the)*np.sin(phi)
up[2]=U*np.cos(the)
v[0,:,p]=up
return(v)
\ No newline at end of file
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment