Author |
Message |
cheng Member Username: cheng
Post Number: 4 Registered: 11-2007
| Posted on Saturday, May 01, 2010 - 12:47 pm: | |
I would like to describe the filling of a rectangular cavity. The cavity should be initially empty, and it should be filled by a fluid. I'm sure this should be a quite simple problem to be solved with flexpde, but I'm not able to use the moving boundary. I attach the script I wrot, but it was a really bad attempt. Could you let me know where I'm wrong? Very many thanks indeed TITLE 'Viscous Flow in a Slit' { fex231a.pde } SELECT errlim=1e-2 COORDINATES cartesian2 VARIABLES vy(1e-5) p vx(1e-7) Vm Ym DEFINITIONS s1=5.0e-3 L=1*s1 vy0=1e-3 visc=2.5e-5 dens=0.785 cond=0.0363 Cp=1020 rcp=dens*Cp penalty=1e2 v=vector( vx, vy) vel=magnitude( v) INITIAL VALUES vx=0 vy=0 EQUATIONS vx: dx(p)- visc*del2( vx)+dens*(dt(vx)+vx*dx(vx)+vy*dy(vx))=0 vy: dy(p)- visc*del2( vy)+dens*(dt(vy)*vx*dx(vy)+vy*dy(vy))=0 p: div(grad(p))- penalty*visc/s1^2* div(v)=0 Ym: dt(Ym) = Vm Vm: div(grad(Vm)) = 0 BOUNDARIES region 'domain' start 'inlet' (0,0) natural(vx)=0 value(vy)=vy0 natural(p)=0 VALUE(Ym)=0 VALUE(Vm)=0 line to (s1,0) { In } value(vx)=0 value(vy)=0 natural(p)=0 VALUE(Ym)=s1 VALUE(Vm)=0 line to (s1,L) { Wall } value(vx)=0 natural(vy)=0 value(p)=0 VELOCITY(Ym)=vy VALUE(Vm)=vy line to (0,L) { Out } value(vx)=0 natural(vy)=0 natural(p)=0 VALUE(Ym)=0 VALUE(Vm)=0 line to close { Axis } Time 0 to 1000 MONITORS For t=0 by .01 to 1000 vector( vel) PLOTS For t=0 by .1 to 1000 vector( vel) END
|
rgnelson Moderator Username: rgnelson
Post Number: 1357 Registered: 06-2003
| Posted on Tuesday, May 04, 2010 - 08:36 pm: | |
1) A moving mesh coordinate surrogate must be declared as such with the "MOVE" designator, eg, Ym=Move(y). 2) The coordinate surrogate is a copy of the associated mesh coordinate, and defaults to the initial mesh layout. You cannot assign Value(Ym)=s1, as this is not the proper value of Y along the right side. 3) You can declare the mesh velocity to be zero along the right side if you want to, but this causes a parabolic top boundary. If you are filling a cavity, I would expect the left wall to move. 4) Wherever you declare the mesh velocity, you must make VELOCITY(ym) the same or the system will be self-contradictory. See attached.
|
cheng Member Username: cheng
Post Number: 5 Registered: 11-2007
| Posted on Wednesday, May 05, 2010 - 05:15 am: | |
Thank you for your answer. I modified the script according to your suggestions and now it works nearly properly. (sorry for the txt extension, I had problems with the upload). However, there is a problem with the grid (or at least I think so). I was compelled to use a mesh_spacing command, otherwise after some cycle the mesh stretches and the program stucks. Maybe I can force somehow the program to remesh after some cycle. Can you help me? |
cheng Member Username: cheng
Post Number: 6 Registered: 11-2007
| Posted on Saturday, May 29, 2010 - 06:18 am: | |
I tried to force FLEXPDE to use a higher mesh density by introducing a mesh_spacing. However, this cannot be the best solution. Can you sugest a better one?
|
rgnelson Moderator Username: rgnelson
Post Number: 1370 Registered: 06-2003
| Posted on Saturday, May 29, 2010 - 01:24 pm: | |
There is an old saying: "Be careful what you ask for -- you might get it." 1) You have asked for an accuracy 25 times worse than the default, and you are getting it. 2) By pulling the left wall along with the fluid and freezing the bottom velocity, you have asked to tear the mesh apart at the bottom left corner. You are getting that, too. It is the ripping apart of the left corner mesh that dooms the computation. Plot a contour of Vm and you will see what I mean. 3) By freezing the mesh motion on the right sidewall, you have created a meniscus effect on the top surface, but you have not specified the fluid properties that will determine the curvature of the meniscus.
|
cheng Member Username: cheng
Post Number: 7 Registered: 11-2007
| Posted on Wednesday, June 02, 2010 - 11:32 am: | |
You shall excuse me if I don't understand. I have in mind the following sistem (which is symmetric and thus I will study just one half) The inlet is from the bottom part. In my mind, the mesh should follow the violet surface and the simulation should finish when the black box is completely full. The script aims at doing that. Are the boundary conditions wrong? Thanks for trying to help me |
|