查看完整版本: Narrow Gaps

michael 2007-9-4 10:59

Narrow Gaps

[size=2]I've attached the code "Boundary_Prob" which includes a 2-d cylinder being pushed by fluid through a 2-d tube. The cylinder is rather close to the edge of the tube and there is a gap there of about .0001 units. In this case it seems that FlexPDE assumes the cylinder and wall of the tube are connected as is evidenced by the plot elevation(u) around the cylinder. In particular, since the plot elevation(u) around the cylinder has only one point where u is zero (and everywhere else u has magnitude significantly larger than 0), it seems FlexPDE simply connects the very bottom point of the sphere to the tube and leaves everything else alone. i8CA oQls$[.d.q

%M*Z$xs)G.v1C)i~ For the codes that I am running, inevitably the "cylinder" will get very close to the edges of the "tubes". When it does so, it is unrealistic for the velocities of the points nearest the wall to be zero.
cCw&d5sf D$[M6[wY;f
It seems there is a tolerance which, when the gap between two boundaries is narrower than that tolerance, the two boundaries are joined (in some way). If there is, what is that tolerance and can it be changed? (In the problem I've sent you, the tolerance appears to be .001 but I don't know if that tolerance will change in my other codes...e.g. is it an absolute tolerance or a relative tolerance depending on the size of the geometry being considered.)
h-gz o9s&W_
R6h2i t3gW Are there any other suggestions that can be made for how to fix this sort of problem? [/size]4c7F&|f C*f y
[size=2][/size] Zj!c)QyE f6n aW4S
[quote]
.BG-|7N ]6nU title 'Viscous flow in 2D channel, Re < 0.1'variables   u(0.1)   v(0.01)   p(1)scalar variables   um   vm   omegadefinitions   Lx = 1       Ly = 1   Gx = 0       Gy = 0   p0 = 1   speed2 = u^2+v^2   speed = sqrt(speed2)   dens = 1   visc = 1   vxx = (p0/(2*visc*Lx))*(Ly-y)^2      { open-channel x-velocity }   rball=0.25   cut = 0.05  { cut the corners of the obstruction }   myshift = .25-.00099   xm1 = Lx/2   ym1 = Ly/2-myshift   penalty = 100*visc/rball^2    { "equation of state" }   sigma11 = 2*visc*dx(u)-p   sigma21 = visc*(dy(u)+dx(v))   sigma12 = visc*(dx(v)+dy(u))   sigma22 = 2*visc*dy(v)-p   TotForX = line_integral(normal(sigma11,sigma12),'myball')   TotForY = line_integral(normal(sigma21,sigma22),'myball')   TotTor = line_integral(cross(vector(normal(sigma11,sigma12),normal(sigma21,sigma22)),vector(x-xm1,y-ym1)),'myball')initial values   u = 0.5*vxx  v = 0  p = p0*x/Lxequations   u:  div(grad(u)) - dx(p)/visc = dens*(u*dx(u) + v*dy(u))/visc   v:  div(grad(v)) - dy(p)/visc = dens*(u*dx(v) + v*dy(v))/visc   p:  div(grad(p)) = penalty*(dx(u)+dy(v))    um:  TotForX = 0    vm:   TotForY = 0    omega:  TotTor = 0Boundaries   region 1      start(0,0)      value(u) = 0  value(v) = 0 load(p) = 0  line to (Lx,0)      load(u) = 0      value(p) = p0    line to (Lx,Ly)      value(u) = 0  value(v) = 0     load(p) =0    line to (0,Ly)      load(u) = 0      value(p) = 0    line to finishexcludestart 'myball'  (xm1+rball,ym1)    value(u)=um-(y-ym1)*omega    value(v)=vm+(x-xm1)*omega    nobc(p) arc(center=xm1,ym1) angle = 360monitors   contour(speed)plots   grid(x,y)   contour(u)   contour(v)   contour(speed) painted   vector(u,v) as "flow"   contour(p) as "Pressure" painted   contour(dx(u)+dy(v)) as "Continuity Error"   contour(p) zoom(Lx/2,0,1,1) as "Pressure"   elevation(u) from (0,0) to (0,Ly)   elevation(u) from (Lx/2,0) to (Lx/2,Ly)   elevation(u) from (Lx,0) to (Lx,Ly)   elevation(u) on 'myball'   elevation(v)  on 'myball'   elevation(p)  on 'myball'end[/quote]

michael 2007-9-4 11:00

[size=2]In version 5.0.18, we implemented a controllable merge distance with the selector MERGEDIST.
;so7NQ.qz#` h~p6z8G;a/]~
Apparently, we did not get all the merge tests modified, and this control does not work in your problem (because the critical measurement is the closest distance between a line and an arc, and this test appears not to use the user mergedist). W)weZ2bs

#m^:STQ0G#]9qcC2m However, if you break the bottom line of the outer boundary at a point directly below the circle, the test becomes joint-to-joint proximity, and works correctly. s3jUf)wr

7@]9Q NSig (We will complete the implementation of MERGEDIST in version 5.0.19)
a9x2hq7v)ojx)@ }!Xn{
See the attached script. [/size]Dh)L fNg \3Z7T

)Z'l[X:DT 9B([#@eCe$G
[code] title 'Viscous flow in 2D channel, Re < 0.1'w b0jB$e
DSa"D"UQ |e
variablesBpt;W2Oe)Y'I
   u(0.1) V W(p,o#DJC&G3W
   v(0.01)
/JR"|.a k.`S    p(1)
g a$jM/F&Uh8|)D0l8y
ZZe/Dlf"B5`'Qf scalar variables
jgy:^y G G:V    um#G Q#`h9W2m
   vm!Jx,k$T8_0u5yH V.QU*b
   omega
D`p n+bw+d#}
CmU w1QF select.L qWT#Fwr8[|P
  mergedist=1e-8
T'KRy |k D 9?(hId2Y e
definitions2c nt X SK\&l
   Lx = 1       Ly = 1
^a V.[z;v;g,JqM3R    Gx = 0       Gy = 0yX'ic&sl&Z
   p0 = 1#},X#?qY'{
   speed2 = u^2+v^22XOE8E+T-KJ~9wp
   speed = sqrt(speed2)
] M+cZ8G    dens = 1
9j3p^:l ]1H*J-m    visc = 1
[)U'[7B_9R+PY%B    vxx = (p0/(2*visc*Lx))*(Ly-y)^2      { open-channel x-velocity }
L.PCN\1Y aq;T5?
sRuTP2_ ]4p.A    rball=0.25
6g r4jD.xZ?(KN+AH/h    cut = 0.05  { cut the corners of the obstruction }
t PF E(C2tq    myshift = .25-.00099k:F1|c-`/qkK)|2}
   xm1 = Lx/2,v.O `*gQn[
   ym1 = Ly/2-myshift W2I ];c5M;\ ^2Tx'H

K%a ~rk(|n^~+@    penalty = 100*visc/rball^2    { "equation of state" }
p `NQU dJ;Bw:g/mn3D
   sigma11 = 2*visc*dx(u)-p
)i a,A'QWBO    sigma21 = visc*(dy(u)+dx(v));KvkGKI+R!I@]
   sigma12 = visc*(dx(v)+dy(u)) B.D(l*xO
   sigma22 = 2*visc*dy(v)-p&G+vp y)n#z!E;o.z5v
,eJK*f({:d
   TotForX = line_integral(normal(sigma11,sigma12),'myball')4Lv FA-su!`@&V!N&R
   TotForY = line_integral(normal(sigma21,sigma22),'myball')!P? Sn$z(W6ijcQ
   TotTor = line_integral(cross(vector(normal(sigma11,sigma12),normal(sigma21,sigma22)),vector(x-xm1,y-ym1)),'myball')IhHU"a[(? n,Pt

ju)h8m*p&T E%X initial values
x-Hjn9K T    u = 0.5*vxx  v = 0  p = p0*x/Lx
{?e8[D4H@I-jZQ
N4P;g]_:}-K)[ equations+Zr on/u'n q8gU$y
   u:  div(grad(u)) - dx(p)/visc = dens*(u*dx(u) + v*dy(u))/visc
wo?8_?%h]]    v:  div(grad(v)) - dy(p)/visc = dens*(u*dx(v) + v*dy(v))/visc&ed!~%Y `%j$?
   p:  div(grad(p)) = penalty*(dx(u)+dy(v))
E5}SK7Z*J+U o w8x2V(TLG L1X
    um:  TotForX = 0 Jh%Y!PtOJ K k
    vm:   TotForY = 0
,hMc dvKA_U.Zl     omega:  TotTor = 0P]Uif!_
3_ D3[]%K&t,\O
Boundaries
4xw Bqk X    region 19R0o3hYh)T ^.Y
      start(0,0)
6i G(E!Sp-Z/g       value(u) = 0  value(v) = 0 load(p) = 0  line to (xm1,0) to (Lx,0)
BldU$U9ID       load(u) = 0      value(p) = p0    line to (Lx,Ly)ZA U!l~
      value(u) = 0  value(v) = 0     load(p) =0    line to (0,Ly)
U#sG8Mw)H%d6r       load(u) = 0      value(p) = 0    line to finishaG B|;~,kBB
7vhZ-Vd*j.h
exclude
5q]mAE P&_ start 'myball'  (xm1+rball,ym1)Rr"S\gs0Ps/A
    value(u)=um-(y-ym1)*omega
&a}%s'N\     value(v)=vm+(x-xm1)*omega:CFBN-Z+@Q3P~4q
    nobc(p) arc(center=xm1,ym1) angle = 360.W/]7v `t o;a1J

8fZ9kpq6_} monitors
Z b4m"m lH    contour(speed)
/`mW RX grid(x,y) zoom(0.48,0, 0.04,0.04)
?KKE^ `#_3S ]%P'B k~
plots"u'[1jG ydn*[;w
   grid(x,y)lX/fUX[
grid(x,y) zoom(0.48,0, 0.04,0.04) a2zn*?H
   contour(u)
i)Atus gi    contour(u) zoom(0.48,0, 0.04,0.04)9ti({+Q#y q @
   contour(v):FwH @3n
   contour(speed) paintedEomsVRd
   vector(u,v) as "flow";z}5y bOw~D
   contour(p) as "Pressure" paintedEn.fc,?1~
   contour(dx(u)+dy(v)) as "Continuity Error"8W#YK,]v5~-H9N
   contour(p) zoom(Lx/2,0,1,1) as "Pressure"eF-U V1I ]9Ch
   elevation(u) from (0,0) to (0,Ly)w#s8q3d"_X'w
   elevation(u) from (Lx/2,0) to (Lx/2,Ly)sT Vx$r;eom
   elevation(u) from (Lx,0) to (Lx,Ly)'?C(O6e Wlb'N7b
   elevation(u) on 'myball'mVlS6gFo
   elevation(v)  on 'myball'
6c"g&z2_4{m+_9J    elevation(p)  on 'myball'
;n]6|`G"~:Uy5~O BR0K+p t}/}I#m&X \)w4Cg]
endaRaRWe

(}GpQ7pR Z ~0O._fExi7W2d6I
[/code]
页: [1]
查看完整版本: Narrow Gaps