查看完整版本: question about volume flow

michael 2007-9-4 11:03

question about volume flow

[size=2]I've built a 3D diffusion model in which substance enters the model from a finite source (e.g. a droplet). This means, the particle source has got a starting volume which decreases over time, and if the volume reaches 0, the flow of particles will stop . The amount of substance entering the model in one timestep depends on the volume which enters the model out of the source. I've realised the decreasing volume of the particle source by implementing the global variable vol into the system. The decrease of volume is being calculated by the law of Hagen-Poiseuille (Volume flow V out of the droplet through a round pore) and realised in the EQUATIONS section by dt(vol)= V. I've monitored the development of vol in a history plot, and the curve is not as smooth as it should be. Also, in the system there are exp-functions implemented in whose exponents the variable vol is being used, e.g. exp((-vol)/6.13249e-16). At a point where vol comes close to 0, FlexPDE stops the simulation with an 'exp argument too big'- error. I've worked around this difficulty by using an IF THEN ELSE construct, but I fear that something in my system is not working properly. Also, I've tried different parameters (s. .pde-file), and sometimes the exp-error occurs, and sometimes it doesn't.
WK.rF,}Fdsl Another question: Is it possible to take the inflow of volume from the source into the system into account when calculating the particle concentration? Considering an incompressible fluid, the volume entering the system pushes the particles in the system further away from the inlet. Is there a formula to calculate this?
Z3p(N'JQ2] I hope you can help me out! [/size]
G9uP d)~ ` o'{W [size=2][/size]
zU({#MD D*S,aV [size=2][/size]
iiNn ]a.|8KFX [code] title
|$_:sP6[]/?   'Diffusion and convection of ACh'!K9Y#M v"PlR ^Pu
H3Q8i0g%Ji-n {9|
coordinates cartesian3
"p;UF)a#O;p 7EW Bp[4q#Z[&y
variables
7xTX+m,@w,Y!S   u(threshold=1)  !1e-3
E5mkS'T 2B"hTD/y9{iEP.@
global variables
&`~G OZ9W   vol(threshold=1e-18)  !droplet volume
'at;K)y-G -T-iU~ N

Qoo yx2k;`x definitions A!A1@b8rJy)ZB
   D = 12.2e-10              { Diffusionskoeffizient [m^2/s]  ACh}
j h{4O&o2u9kB
6bC a$Pj"K`*l/^#Z { System variables }(k&Dv| I Cq
  r_ben = 3e-5  !Inlet area radius [m];~9ULa'q5E`
  height = 1.8e-3 !cylinder height [m]
W O e8FY NT   r = 9e-4  !radius of cylinder [m]!L;SGPz-k9a
a!V%Hm+f3H
{ Membrane parameters }  !here, different parameters have been used
2l6uQ2W*|'}M,c,j$W uC0p&q#t~@*t
!diameter of pores!k$gx-AL G[yx ~;v
d_pore = 2e-7  !1e-7, 5e-8, 1e-6iRf1H"WFs/wJ
!thickness of membrane [m]TDF8D8e
d_mem = 10e-6}j8_!W@ @$l6mg)v
!freie Fl鋍he der Membran
+`*T!{"k:jY&zh ff = 9.43/100 ! 5.54, 1.54, 15.7
xfXI ie y8d/~"Brr5_ N8B`L+_
!Stoffmenge, die insgesamt im Tropfen zur Verf黦ung steht [mol] = Ausgangskonz. [mol/m^3] * Start-Tropfenvolumen [m^3]
!e.^*j\J v0 = 26e-15  !starting volume of droplet
w~ LqQ!gv6XEN a_drop = 1 *  v0 !concentration of substance in droplet (1mMol)/\3] ]p'R"T

bt[X~/i O !Fluss aus der Quelle:7\_B.J.C5B
!J =  (D*(((a_drop-integral(u))/vol)-val(u,0,0,1e-6))/d_mem)*ff  { Einheit: [mol/m^2*s] }
G'N api'N4S'uK)n1X J =  IF  vol <= 20e-20 THEN 0 ELSE (D*(((a_drop-integral(u))/vol)-val(u,0,0,1e-6))/d_mem)*ff  !SWAGE(vol-(2e-14), 0, (D*(((a_drop-integral(u))/vol)-val(u,0,0,1e-6))/d_mem)*ff, 2e-3)  { Einheit: [mol/m^2*s] }
N9F`$O;ba[a'i (Mgz r:DR3p
!************************Oberfl鋍henspannung, Konvektiont)m[I ai$n|2c;i?
!z7m1QxKA8`
! surface tension(H2O) = 0,073 N/m\QO/h2B:sw
s_drop = 0.0734cqNXud(F/Yu
!dynamic viscosity = 0,001 Pa*s = N*s/m^2+T;Z7c0y%yW
dV = 0.001] X6Aiq#_E(b
  !number of pores in inlet area
akdbc~S D*D N_pore = 8.49e3A*X%]:I Y7p3F
%?jd O R$tV]
!Calculation of contact angle teta and drop radius r_drop via v_drop and r_ben
*E6M7E/lp;Q6]h !Formel aus Origin: x = Tropfenvolumen v_drop, y = Tropfenradius r_drop
?0c7f8z&X`[j9_,~ _{7@3z Z0RLO
a1 = IF vol <= 20e-20 THEN 0 ELSE (-vol)/3.3553e-15
.Vj0[lh a2 = IF vol <= 20e-20 THEN 0 ELSE (-vol)/6.13249e-16 \5Adg|7}

$?8sv5D*Y;m p"y8h.aD a3 = (3.73568e-4)*exp(a1) + 0.00162*exp(a2)
q5z;uT"XA r_drop =  a3 + 4.74773e-5
uG(P3tG;U;Y"p(T x 2e&j qS[1y{
!r_drop = 4.243e-5
,~9A$H n}x nJx9PT{x4x G%B
!contact angle: Kontaktwinkel = Zentriwinkel/2 + Umrechnung ins Bogenma?(->rad) f黵 cos(x) ABER: arccos(x) braucht x in Grad(?!: eAD6oy&?l `UJI
teta = (180/pi)*arcsin((2*r_ben)/(2*r_drop))n2` h&V&`%^q M$q _-M
!teta = (180/pi)*arcsin((2*r_ben)/(2*4.243e-5))
~Is7A aUO&^
-v `D QH~1Y
i@!T*{ ?M*^V !droplet pressure: Berechnung des Drucks innerhalb des Tropfens
gW QL#m pcap = (2*s_drop/r_drop)*cos(teta*(pi/180))
)^VS,D%j-m w^ !pcap = (2*s_drop/4.243e-5)*cos(teta*(pi/180))o:Y0M z J C(ND k3P#B

_"KE{!UY^7\ `(M!RPI

wnT*T7e8E LD !Gesetz von Hagen-Poiseuille (ohne Kinetik des Aufpralls des Tropfens)N8Ey{ C-Z
V_hp =  -((pi*(d_pore/2)^4)/(8*dV))*((pcap*N_pore)/d_mem)#H5wc(Ehe
!Fluss [mol/s] = Konz. im Tropfen [mol/m^3]*V[m^3/s]  ->Fluss durch ALLE Poren (ges. Ben.fl鋍he) ->/Ben.fl鋍he: [mol/m^2*s]
/zx:ItOJT !J_hp = (((a_drop-integral(u))/vol)*(-V_hp))/(pi*r_ben^2)#yk([_2d#Qm r
J_hp = IF  vol <= 20e-20 THEN 0 ELSE (((a_drop-integral(u))/vol)*(-V_hp))/(pi*r_ben^2)  !SWAGE(vol-(2e-14), 0, (((a_drop-integral(u))/vol)*(-V_hp))/(pi*r_ben^2), 2e-3)M{*g;P0w!p.G

D v7WCPZ"F3_ J_ges =  J + J_hp  !SWAGE(-vol, J+J_hp, 0, 2e-3)
x$z|!M#~._!_y~ !**************************************9OiY%o.{"Y

3q8B"R ^WN !Zeitschritt der Simulation [s]
|@7lcm r#n&}_ timesteps1 = 0.0005
V@:G4II9ya,ic v timesteps2 = 0.2
J.G5`1v:R,y timesteps3 = 5e-7GO4s(j9oK @;A
timesteps4 = 0.057W'H:z/D(f
H)ph.{d
initial values  { Anfangswerte der Variablen }B c p`|&aN
  u = 0
{0MSy4S$^   vol = 26e-15vyz.v]8sHV@
'c2q+{n6m9I
equations
8?'Xk}N!Nw u: div(D*grad(u)) = dt(u) { Diffusionsgleichung }uz,[qJ9]jy
vol: dt(vol) = v_hp  !膎derung des Tropfenvolumens 黚er die Zeit: Vdrop(n+1) = Vdrop(n) - Volumenstrom(n+1)6N~/DGR
F e|G \"[(\#P2Sp
extrusion  { 3D-Struktur }X"b'{}:mc A s

/]Bz)jLC)a y\ surface 'fluid_bottom' z = 0^a(LDb u
    layer 'fluid' RYV~4M/F_
surface 'cylinder_top' z = height
JZ.OH QPH
#L@+a+PX"n5~
#x^W7d.c5t:do J { Erstellung des Gef溥es und der Quelle }
_B8W&F*U boundariesa0B'su;o4|6F#d%I
region "cylinder"  { Rundes Gef溥 }.i|[]T:C{2[ s
    start(0,r)
X@&V jH.F     arc(center=0,0) angle 360 nYG6InG"g*A
E'o6Z#E D2R
limited region "bottom_pore"  { Beschr鋘kung von 'bottom_pore' auf 'fluid_bottom'. }
-k ^gZ-W:j+m ?2iV   surface 'fluid_bottom'
a:po2\{']TC   natural(u) = J_ges   !J+J_hp  { Randbed.: Flux an 'fluid_bottom' in der Region 'bottom_pore' = D*grad(u) }
*c |TpK {g
bG~F2X    start(0,r_ben)   { runde Quelle, Radius = Rad. der Benetzungsfl鋍he }4L#z;j2M$s.Ni!A g5^9Bq
   arc(center=0,0) angle 360^U[x3V| ^yp

mA}7|'Q~#pz#q time from 0 to 3e-6 by timesteps3 to 0.025 by timesteps1 to 1.5 by timesteps4 to 30 by timesteps2*]/B_;_%?zbi0s(a'xi%e
yCZt7ysW
plots  { Ausgabe der Schaubilder }5f/@S"SH
  for t = 0 by 0.06 to 0.3 by 0.1 to 1.5 by 0.2 to endtime
`XY])Kvm-F     contour(u) as 'Konzentration ACh' on y = 0  painted nominmax notags noheader zoom (0,0,4e-4,7.5e-4) !points = (14,70) export format '#t#x#z#1' file = 'Contour_1mmol_1祄_IFTHEN_20e-18_diff+konv_dz=5祄.txt' merge noheader  !range (0.01e-2,3.5e-2) PNG
i%P}TRu#zw     contour(u) as 'Konzentration ACh 100nm-Membran' on y = 0 painted nominmax notags noheader
,}4z:Tx^     elevation(u) from (0,0,5e-6) to (7.5e-4,0,5e-6) points = (150,0,0) export format '#t#x#1' file = 'ACh_5祄_1mmol_200nm_flow+kin_dx=5祄_02.txt' merge noheaderXik N&S3Q9R4P
    elevation(u) from (0,0,0) to (7.5e-4,0,0) points = (150,0,0) export format '#t#x#1' file = 'ACh_0祄_1mmol_200nm_flow+kin_dx=5祄_02.txt' merge noheader
p2{?c[&PV3J`     elevation(u) from (0,0,7e-6) to (7.5e-4,0,7e-6) points = (150,0,0) export format '#t#x#1' file = 'ACh_7祄_1mmol_200nm_flow+kin_dx=5祄_02.txt' merge noheader4l X~1H?V
    elevation(u) from (0,0,1e-5) to (7.5e-4,0,1e-5) points = (150,0,0) export format '#t#x#1' file = 'ACh_10祄_1mmol_200nm_flow+kin_dx=5祄_02.txt' merge noheader
6D&Q.m2b5pp4? elevation(u) from (0,0,15e-6) to (7.5e-4,0,15e-6) points = (150,0,0) export format '#t#x#1' file = 'ACh_15祄_1mmol_200nm_flow+kin_dx=5祄_02.txt' merge noheader
"y)m/d7f(P 6Gi:g"zc6R4W:J%O
Summary export file='Summary_ACh_1mmol_200nm_diff+konv_dx=5祄_02.txt' merge noheader
E8q+O-_A1Rz   report(t) as 'Zeitpunkt'
Ij(p"?%BT2kS(H9Y   report(J) as 'Fluss aufgrund Diffusion'
G li(Jr'Q2BX   report(J_hp) as 'Fluss aufgrund Konvektion'
g!`2f eA.i1H"Yu   report(J + J_hp) as 'total input flux (j + j_hp)qr3@ U\7uX'a
  report(J_ges) as 'J_ges',u:m0Fn/DdW4Q
  report(V_hp) as 'Volumenstrom aus Tropfen (Konvektion)'
-Tf0l o;Rc   report(integral(u)) as 'Teilchenmenge im Zylinder'3Y-R!^+}C0K D,qK
  report(a_drop-integral(u)) as 'Teilchenmenge im Tropfen'
l6s _;B at&QIPC sm*f"d!`7y g N
report(vol) as 'Volumen des Tropfens (vol)' xj0x,[ Z'g:O)o

@ H2l }`,{C`   report(r_drop) as 'Tropfenradius'
jp+o m6s"o   report(teta) as 'Kontaktwinkel'
M7Zp*\R _}   report(pcap) as 'Kapillardruck'!x1n3FQ)?

At l*m OA*rs   report ((a_drop-integral(u))/vol) as 'Konzentration im Tropfen (/vol)'
)]$P|gA-Rd b 2? G-? w%`%I'mf
  report(Tintegral(surf_integral(J,'Fluid_Bottom','Bottom_Pore'))) as 'total J (surface integral,tintegral)'/F5Y2iYG[.}E`m
  report(Tintegral(J*pi*r_ben*r_ben)) as 'total J*pi*r_ben^2(tintegral)'
Ke{6b`? report(surf_integral(J,'Fluid_Bottom','Bottom_Pore')) as 'total J (surface integral)'
|O J0D2}dP report(J*pi*r_ben*r_ben) as 'total J*pi*r_ben^2'L`Xj3T E\

$d(n6{5NB lL   report(Tintegral(surf_integral(J_hp,'Fluid_Bottom','Bottom_Pore'))) as 'total J_hp (surface integral,tintegral)'
-p9d2~$H!G'I6Z   report(Tintegral(J_hp*pi*r_ben*r_ben)) as 'total J_hp*pi*r_ben^2(tintegral)'
iwxdKqSg6]O   report(surf_integral(J_hp,'Fluid_Bottom','Bottom_Pore')) as 'total J_hp (surface integral)'
b9Dy({,b4k   report(J_hp*pi*r_ben*r_ben) as 'total J_hp*pi*r_ben^2'0t\VpX{
2q7r~e-P/l
History(a_drop-integral(u))mO/o$s_Jue
history(pcap)
6BA+s,|a i history(teta)
+j'G)us4_;^x? History(V_hp)
Yj3W~ H#` History(vol)
L)Lco{!n#\@X history(j)
`'@ |sqf5I'aph history(j_hp)OOW"[0Zg
history(J_ges)2x9k6Tn7kp1m:Z
!history(SWAGE(vol, 0, J+J_hp, 2e-3))
|#s#jKvGZ:e m&D G6~l3L_!K
! table(u) zoom(0,d_mem,50,50)  points=50 merge noheader format "#t#x#b#y#b#1" file="table_dmem_.tbl"Bu%k `~5B
;T g|%QR1JG
|u2`^{]
  {report(integral(u,"drop_cyl","fluid")) as 'Volumenintegral im zylinder 黚er der Benetzungsfl鋍he'
*?"m `:q Yipll X   report(Tintegral(Surf_Integral(-D*dz(U),"Fluid_Bottom","Bottom_Pore") )) as 'total input flux(dz)'u3PC.z(Ux
   report(Tintegral(Surf_Integral(-D*dz(U),"Fluid_Bottom"))) as 'tif(dz, Fluid_bottom)
%I+z9o1M,RTrn,QW H g/Ss3@Y.c
  report(surf_integral(-d*dz(u),'Fluid_Bottom','Bottom_Pore')) as 'total dz(u)(surface integral)
AZ"B!}t2x   report(Tintegral(surf_integral(-d*dz(u),'Fluid_Bottom','Bottom_Pore'))) as 'total dz(u)(surface integral,tintegral),~2z^ hL#K
  report(val(-D*dz(u),0,0,0)) as 'Normal flux at (0,0,0)'l9k#wx:p a
  report(Tintegral(val(-D*dz(u),0,0,0))) as 'time integral of normal flux'3QE#X&R iJh8H
  report(val(-D*dz(u),2e-5,0,0)) as 'Normal flux at (2e-5,0,0)'$P)})G n(\,n

z8TCQ+xx T/b !TRANSFER: schreiben des Meshes in Datei
(r m(YWm8e   transfer(u) file = "eFQ_mesh.dat"]y BdI W ?
}8R x5f,Y1g$D
Fd(T7EQ

-QG k*ry,|-Q| end?VYJYTp-_2zS
z.HSD.k1eLWK
8v#fq7NSRgP

9d1c!Geyw A i [/code]

michael 2007-9-4 11:04

[size=2]1.
Ks^!xv!E6` You have set the Threshold for U at 1, while the actual values of U are significantly smaller than this. THRESHOLD is "the smallest variation for which you wish FlexPDE to maintain accuracy". In declaring a threshold of 1, you have essentially allowed 100 percent oscillations in some areas. I believe this is what is causing the ragged behavior of Vol. Restore the Threshold of 0.001 that you have commented out, or make it even smaller, so that accuracy will be maintained in the small wings of the U distribution. R"[-}+uv`

kY RnP:?7S${,qi:O 2. t _3I+SCRN4H:m
Your input flux is clamped at zero when Vol falls below 20e-20, but the time rate of change of Vol is not. So vol continues to go negative. This may not matter, since the flux is zero, but it looks funny on the plot.
+](gR5O7Z[ x!^
/Ph1y Nu O]%{|7y 3.
1Z)M?DB In principle, you could model the pressure increase and fluid motion due to incoming material, but my guess is the diffusion dominates the process. [/size]
页: [1]
查看完整版本: question about volume flow