查看完整版本: fluid flow boundary conditions

michael 2007-9-4 10:52

fluid flow boundary conditions

[size=2]I want to model a velocity distribution in a 2D model (for testing, later on I want to implement the same in a 3D model). The model is designed like the example fex291 in the Backstrom book 'Fluid Dynamics'. But in my model the velocity inlet is very small compared to the whole model, and the velocity distribution is radial from this inlet. I want the left, upper and right boundary of the model to be treated as non-existent, meaning the radial velocity distribution should continue through these boundaries as if they weren't there. How do I have to change the boundary conditions of the left, upper and right side of my model to accomplish this? I've tried getting there with the NORMAL(v) operator and the GRAD(vx) operator, but I'm not convinced that I'm on the right track with this... How is it done correctly?
p3X$@wDqH/G
Z,p!LA`Z What I've achieved so far is attached to this post.
rQK W4@ Q
3`"Bv;aY%q:Y~*F ] I've got another question:
a%z8tz1\)f In the simplified PDE, the pressure is being calculated by -c*div(v). How do I know if I've chosen the constant c correctly? Can I somehow link it to the compressibility of water? [/size]5O$yR2mWr6WeB
.@9r5|%XA#^Jmyu
ZQ&p-nx+Hl3[
TITLE 'Flow velocity in cylinder steady-state with uniform Velocity of Injection'p#D'BV;aU DW$N
SELECT errlim = 1e-5 ngrid = 4 spectral_colors*g4o/kW4w9M
COORDINATES cartesian2f"F ?O3a`9v$s9B7N5hU
]7Q@0{7} O@2j
VARIABLES vx(threshold=1e-4) vy(threshold=1e-4)|5G{.Sn3[E
DEFINITIONS
GOOADi"|K6N   Lx = 3.0 Ly = 2 Lz = 1.0 r0 = 1.0ZA7T-K&DB)Q4Y
  visc = 1e-3%[O3pW"K
  vy0 = 0.00638
d1iuHW*z   dens = 1e3"y l7j W`'Y*t
  Re = (dens*globalmax(vy)*2*(1e-5))/visc
Z%|rb9]VV   v = vector(vx,vy)Kg]Uo)Qu
  vm = magnitude(v)
0e:\Kzm.E Q P,Jp
Qaj {`   c= 1e4*visc
iE(Nvsc7K|Q*PE~   p = -c*div(v)e W@i a s

A3Z^8R~+\]4N   r_ben = 3e-5+H:D#Iv6VyF%K5Sd5S5]
height = 2.6e-2
o6e_7H4U_ F   r = 2.6e-2rcW8{(^'Z.o

I^3x8A*I w EQUATIONS5gdS$h+Q _
!steady-state:3h5C^&S){1GO*r
   vx:        dx( p)- visc*div( grad( vx))=0                                 A%k4LO.\L,a$Rx
   vy:        dy( p)- visc*div( grad( vy))=0
G\%J~I4Z
7]a'GH heX boundariesR(H)k!c:x.r9sF
6c6^\ D+eR1YY]T
region "cylinder"
G-M1B7q/OFN{#f     start(-r,0)-l|aP{`:a3l\D;c D
    value(vy)=0 value(vx)=03l7@m#F#@t;iC @ L
    line to (-r_ben,0)
N w&fwY^$\     natural(vx)=0 value(vy)=vy0 line to (r_ben,0)
v2cKl#f"^     value(vy)=0 value(vx)=0 line to(r,0)
UO&JE$k/X}V     natural(vx)=normal(vx,vy) natural(vy)=normal(vx,vy) line to(r,height)
B'} Q!Tf:@Y     natural(vy)=0 natural(vx)=0 line to (-r,height)hS DBA"^"O1~/pD
    natural(vx)=normal(vx,vy) natural(vy)=normal(vx,vy) line to close
G I&[*h%^,gf,d*R     !nobc(vx) nobc(vy) line to(r,height) to (-r,height) to closeW;^%YE9~o

\0\+lo3Uk{N;H {;`D.G~1SO-QJA
region "cylinder"  { Rundes Gef溥 };E Va#X.@v)T[ d
    start(-r,0)
']s7y*xT     value(vy)=0 value(vx)=0[6SI `A+@7O*y
    line to (-r_ben,0)
"Txr:U%a5~ ?     natural(vx)=0 value(vy)=vy0 line to (r_ben,0) vq8q_C:pUdO9[
    value(vy)=0 value(vx)=0 line to(r,0) to(r,height)oo k gk+w
    natural(vx)=0  natural(vy)=0 line to (-r,height)
'L!T,eq{2k0sg     value(vy)=0 value(vx)=0 line to close
:}-pg*k b+]8e!@!g hN6V }6A2FO)M M!d
MONITORS-g8A*PiS7ilPF u
j(b.Gd-p*{Sp4]:J
  contour(vy) painted  report(Re) !zoom(0,0,3e-4,3e-4)
(P0QC/J#Q   contour(vm) painted fixed range(0,0.3e-4) !zoom(0,0,3e-4,3e-4)
Al U7V;L?&]L   vector(v) norm fixed range(0,1e-5) !zoom(0,0,3e-4,3e-4)
*oT+Y-pf^   vector(v) norm zoom(-1e-2,0,2e-2,1e-2) fixed range(0,1e-4)
%U,k,W-{vE   contour(p)
*{\.]E*J6kC$P@   elevation(p) from(-r,1e-5) to(r,1e-5)
KQ/tRNJZVl"J   elevation(vy) from(-r,1e-6) to(r,1e-6)
,hCL C AQ   elevation(vy) from(-r,height/2) to(r,height/2)2oZ8m6R,uq D"w
  elevation(vy) from(-r,height-1e-5) to(r,height-1e-5))V*f}v1L(pD

p:z2U2a7G4v| PLOTS
R2@%md'CW cu5M1XC L
  contour(vy) painted  report(Re) !zoom(0,0,3e-4,3e-4)
H8z{'I0T5D v\   contour(vm) painted fixed range(0,0.3e-4) !zoom(0,0,3e-4,3e-4)
O$G.ovt   vector(v) norm fixed range(0,1e-5) !zoom(0,0,3e-4,3e-4)
c@r-m GQSn   vector(v) norm zoom(-1e-2,0,2e-2,1e-2) fixed range(0,1e-4)gw@#qht\pn|\-g
  contour(p)Q8jG`mA"g+q-vk8G
  elevation(p) from(-r,1e-5) to(r,1e-5)_/[9d6Xa8GX*x
  elevation(vy) from(-r,1e-6) to(r,1e-6)&Gi9T)D:n|
  elevation(vy) from(-r,height/2) to(r,height/2)T)o2s@m%o
  elevation(vy) from(-r,height-1e-5) to(r,height-1e-5)z6LM0Qy

5]4e0kmB\D8VE7x transfer(vx,vy) file="NS_transfer_small.dat"
C]nQ;op'z:p
o$My^.v3{p END

michael 2007-9-4 10:52

[size=2]1. 3@r;Z,B:L.LB+T @"u
When you substitute the definition of p, the term dx(p) is of second order, so it is integrated by parts, as is visc*del2(vx).
,Z1p"s-P6`ip l^ a YD{za
The meaning of the Natural boundary condition for Vx is therefore
wp/xf)i_ T1gb2~ P-visc*dx(Vx) on the right %B$o s @?;J
-visc*dy(Vx) on the top
sp^8M9O xF -P+visc*dx(Vx) on the left
(u^Z#yn+U 2gGU^aq4UO
Natural(Vx)=0 therefore means
&V`&r0]_!zry2k P=visc*dx(Vx) on the sides
6M ^S-W#WE;}g)d1J/{ dy(Vx)=0 on the top.
BR lG k6HR |K/~4T~yCm-F-W
Similar arguments apply for Vy. (i0]`%{r8b1y:@+w
*X3A2K\6s[)[1J
It therefore seems that Natural(Vx)=0 and Natural(Vy)=0 are the BCs you want on all three sides. BMxW7d
-\j-Hi$h$A*S#IJ
If you try this, you will see that the flow passes transparently through the boundaries. Material is drawn in at the bottom sides and forced out at the top. This is because the injection drags material upward, and this material must be replaced by inward flow from the sides.
3IVcb0NkO*j ] .} h9A+BzX

/@%Y-tO#Lk Y0A 2. "y5xv.e@Q8I'c)lk }[
If you substitute the definition of p into the Vx equation, the equation becomes -(C+Visc)*dxx(Vx) + <other> = 0. .JQ ? j`8NpBa
You should therefore pick a value for C which is large compared to Visc, but not so large that Visc is lost in roundoff error. The 1e4 you have used is reasonable. If you make it too large, it will dominate the numerics and the iteration will not converge. If you make it too small, the material will become compressible. CV,b2v-^5P9H
#h!r y7~#s%f"E
You do not want to relate it to the compressibility of water. This will result in a material that is far to stiff to be numerically tractable.
$pq!O:k(p5s :q oD d ^W
3.
0g'] jyY@V;_ xL&K3bP3s If you are looking for radial flow, you might want to use a semicircular domain. See attached script. U1Yp'R*f"T%`fx

2U3G(h~q7^ Ks 4.
;M!FX#F']$G3x Your notes say this is a cylinder, but you are using Cartesian geometry. This means that you are really modelling a strip injection in the bottom of a trough. If you want a cylinder, you should use cylindrical geometry. [/size]
5RMsG] R S0v0C"W8YN/g

z+X)`V7j%f TITLE 'Flow velocity in cylinder steady-state with uniform Velocity of Injection'SELECT errlim = 1e-6 ngrid = 4 spectral_colorsCOORDINATES cartesian2VARIABLES        vx(threshold=1e-4)        vy(threshold=1e-4)        DEFINITIONS  Lx = 3.0 Ly = 2 Lz = 1.0 r0 = 1.0  visc = 1e-3  vy0 = 0.00638  dens = 1e3  Re = (dens*globalmax(vy)*2*(1e-5))/visc  v = vector(vx,vy)  vm = magnitude(v)  c= 1e4*visc  p = -c*div(v)  r_ben = 3e-5 height = 2.6e-2  r = 2.6e-2EQUATIONS!steady-state:   vx:        dx( p)- visc*div( grad( vx))=0                                    vy:        dy( p)- visc*div( grad( vy))=0boundariesregion "cylinder"    start(-r,0)    value(vy)=0 value(vx)=0    line to (-r_ben,0)    natural(vx)=0 value(vy)=vy0 line to (r_ben,0)    value(vy)=0 value(vx)=0 line to(r,0)    natural(vx)=0 natural(vy)=0        arc(center=0,0) to (0,r) to close {region "cylinder"  { Rundes Gef溥 }    start(-r,0)    value(vy)=0 value(vx)=0    line to (-r_ben,0)    natural(vx)=0 value(vy)=vy0 line to (r_ben,0)    value(vy)=0 value(vx)=0 line to(r,0) to(r,height)    natural(vx)=0  natural(vy)=0 line to (-r,height)    value(vy)=0 value(vx)=0 line to close}feature start(0,0) line to (0,r)MONITORS  contour(vy) painted  report(Re) !zoom(0,0,3e-4,3e-4)  contour(vm) painted  vector(v) norm  vector(v) norm zoom(-1e-2,0,2e-2,1e-2)  contour(vm) painted fixed range(0,0.3e-4) !zoom(0,0,3e-4,3e-4)  vector(v) norm fixed range(0,1e-5) !zoom(0,0,3e-4,3e-4)  vector(v) norm zoom(-1e-2,0,2e-2,1e-2) fixed range(0,1e-4)  contour(p)  elevation(p) from(-r,1e-5) to(r,1e-5)  elevation(vy) from(-r,1e-6) to(r,1e-6)  elevation(vy) from(-r,height/2) to(r,height/2)  elevation(vy) from(-r,height-1e-5) to(r,height-1e-5)PLOTS  contour(vy) painted  report(Re) !zoom(0,0,3e-4,3e-4)  contour(vm) painted  vector(v) norm  vector(v) norm zoom(-1e-2,0,2e-2,1e-2)  contour(vm) painted fixed range(0,0.3e-4) !zoom(0,0,3e-4,3e-4)  vector(v) norm fixed range(0,1e-5) !zoom(0,0,3e-4,3e-4)  vector(v) norm zoom(-1e-2,0,2e-2,1e-2) fixed range(0,1e-4)  contour(p)  elevation(p) from(-r,1e-5) to(r,1e-5)  elevation(vy) from(-r,1e-6) to(r,1e-6)  elevation(vy) from(-r,height/2) to(r,height/2)  elevation(vy) from(-r,height-1e-5) to(r,height-1e-5)transfer(vx,vy) file="NS_transfer_small.dat"END
页: [1]
查看完整版本: fluid flow boundary conditions