<< Click to Display Table of Contents >> gaussian_valve_reconnect |
{ GAUSSIAN_VALVE_RECONNECT.PDE
2D_valve in cyinder controlling flow
Mesh motion is imposed by explicit positions of the endpoints.
Script developed using compnents from 2d_stretch _xy.pde and flow71.pde
-- Contributed by Gene DiResta 11/2018
}
TITLE "cylinder with valve"
coordinates ycylinder('r','z')
SELECT
reconnect(on)
VARIABLES
phi (Threshold = 10) {Velocity potential}
rm = move(r)
um(0.001)
DEFINITIONS
Hl = 1/2
gwid = 0.15
ms = gwid^2/exp(-(z^2)/gwid^2)
vm = dt(rm)
vzf0= 0.4 { Velocity at input end }
p0= 150 { inlet pressure }
dens= 1e1 { Mass density }
vrf= dr(phi) {Velocity components - r }
vzf= dz(phi) {Velocity components - z}
v= vector( vrf,vzf)
vmf= sqrt( vrf^2+ vzf^2) { Speed }
p= p0+ 1/2*dens*(vzf0^2-vmf^2) { Pressure }
div_v= dr(r* vrf)/r+ dz( vzf)
curl_phi= dz( vrf)- dr( vzf)
zvalve = 1
zwid = 0.2
pinch = 0.1
motion = 0.5*Hl*(1-pinch)*(1-cos(pi*min(t,2))) ! time-sinusoidal pinch distance
shape = exp(-(z/zwid)^2) ! valve shape
lmove = -Hl+motion*shape ! left boundary valve motion
rmove = Hl-motion*shape ! right boundary valve motion
lvel = dt(lmove) ! left boundary valve velocity
rvel = -lvel
!lspace = zwid*exp((max(min(z,0.3),-0.3)/zwid)^2)/5 ! mesh spacing on valve
lspace = zwid*exp((z/zwid)^2)/5 ! mesh spacing on valve
INITIAL VALUES
INITIAL EQUATIONS
phi: div(grad(phi))= 0
EQUATIONS
phi: div(grad(phi))= dt(phi)
Rm: dt(rm) = um
Um: drr(um) = 0
BOUNDARIES
REGION 1
mesh_spacing=lspace
Start(0,-2*Hl)
natural( phi)= -vzf0 ! Inlet flow
value(um)=0
line to (Hl,-2*Hl)
natural( phi)= 0
value(rm)=Hl
value(um)=0
line to(Hl,-zvalve*Hl)
natural( phi)= 0
value(rm)= rmove
value(um) = rvel ! valve right side velocity
line to (Hl,zvalve*Hl)
natural ( phi)= 0
value(rm)=Hl
value(um)=0
line to (Hl,2*Hl)
value( phi)= 0 ! Velocity potential set to 0
velocity(rm)=0
value(um)=0
line to (0,2*Hl)
natural( phi)= 0
value(rm)=0
value(um) = 0
line to (0,zvalve*Hl)
natural( phi)= 0
value(rm)= 0
value(um)=0 ! Valve left side velocity
line to (0,-zvalve*Hl)
natural( phi)= 0
value(rm)=0
value(um)=0
line to close
TIME 0 TO 2.0 by 0.01
PLOTS
for time=0 by 0.01 to endtime
grid(r,z) zoom(-Hl-1/2,-Hl-1/2, 2*Hl+1,2*Hl+1)
contour( phi)
contour( vmf) painted as "Fluid Velocity"
contour( p) painted as "Pressure"
elevation(p) from (0,-2*Hl) to (0, 2*Hl) as "Pressure"
elevation(vzf) from (0,-2*Hl) to (0, 2*Hl) as "Fluid Velocity"
vector( v) norm as "Fluid Velocity"
END