flow with mass transport Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » flow with mass transport « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

hof
New member
Username: hof

Post Number: 1
Registered: 06-2010
Posted on Monday, June 21, 2010 - 06:30 pm:   

Hi all,
the attached file is my flow/mass transport problem. it is basically a cylinder with pores spaced as seen around the outside of a cylinder. an initial concentration of species A is put in the cylinder and under a flow, (with no concentration of species A), A will diffuse out of the cylinder. so far my flow looks pretty good but i am missing something with the diffusion. I would like for the flow around the cylinder to establish the boundary conditions for the diffusion.

also, it appears to be running really slowly with the boundary conditions i have set for it in that version. another version has 0 flow on the bottom edge and runs much quicker.
any tips?
thanks,
Lucas
application/octet-streamflow and diffusion
Channel_mimic_flow_2d_2.pde (11.6 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

rgnelson
Moderator
Username: rgnelson

Post Number: 1375
Registered: 06-2003
Posted on Tuesday, June 22, 2010 - 01:11 pm:   

1) You have specified boundary conditions of zero flow velocity along the cylinder, but have initialized uniform velocities everywhere. This means there is a disagreement between BCs and interior values, with fluid crashing into instanteously erected walls, fluid flowing inside the cylinder, etc, all nonphysical and requiring small timesteps and enormous meshes to track the compression of the fluid impinging against these walls.

You should run a steady-state solution to the flow problem around the cylinder, and use this to initialize the flow velocities (with TRANSFER to export and import the values). In fact, unless the A material diffusing into the fluid significantly alters the flow, you could use these velocities as a fixed environment into which the A diffusion occurs (ie, you would only need one variable, A).

2) You have not included any advection terms in the A diffusion equation. presumably the fluid will carry the A material along with it, so this must be represented in the A equation by u*dx(A)and v*dy(A) terms.

3) You have specified Natural(A)=normal(D*grad(A)) on interior boundaries. Natural() on an interior boundary is a source, not a statement of flux (ie, it is the deviation from flux conservation). This destroys mass conservation. A flux of D*grad(A) is the normal behavior internally, and requires no BC statement.

4) You have declared BOUNDARIES twice. I don't think this hurts anything, but it might trigger some re-initializations that you don't want.

5) LIMITED is meaningless in 2D.

6) Once having removed the erroneous NATURAL(A) boundary conditions and stating value(u)=0 and value(v)=0, you can trace the whole boundary symply by a chain of "TO(,) TO(,)" clauses. Boundary conditions once stated remain in effect until changed.

7) THRESHOLD declares the smallest variation in the variable for which the ERRLIM condition should be imposed. A THRESHOLD ten times larger than the maximum value of the variable essentially asks for no error control on the value of the variable. The THRESHOLD should be the value at which you no longer care about details.
Top of pagePrevious messageNext messageBottom of page Link to this message

hof
New member
Username: hof

Post Number: 2
Registered: 06-2010
Posted on Tuesday, June 22, 2010 - 03:16 pm:   

Thanks, this is very helpful. I apologize i probably asked my question too soon, i managed to learn a few of those points on my own by reading some other posts. I really appreciate the careful review and input.

1)hopefully i took care of this issue by re-defining my boundaries
2)i think i have accounted for the fluid carrying A along with it with the new equation in the second file, but it is not really apparent that there is any concentration moving in the flow on my monitors. it seems to just be diffusing uniformly.
3)thanks, i took a look at the math again and that makes sense. silly mistake.
4) took that out - probably a copy/paste error
5) took this simplification from a 3d model i had
6)thanks for that tip, i didnt realize that at first. It is also unnecessary to re-define boundary conditions if they stay the same, right?
7)fixed that out, i actually found quite a few posts where people made the same mistake. I was ignorant on that one! should have read the manual a little more carefully

what am i missing with this new model that is preventing a from moving the way i expect it?

thanks a million
Lucas
application/octet-streamSteady State
MIMIC_flow_SS_3.pde (8.4 k)
application/octet-streamtime dependent
MIMIC_whole_radial_channel_3.pde (8.8 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

hof
Junior Member
Username: hof

Post Number: 3
Registered: 06-2010
Posted on Tuesday, June 22, 2010 - 03:45 pm:   

i guess i should mention that this is meant to simulate fluid flow in a microfluidic device, so the major unit in the simulation is intended to be a micron, so i know that the values in the posted *.pde for density, viscosity, etc... are not correct. Changing them doesn't seem to do much though.
any input is very helpful.
thanks again,
Lucas
Top of pagePrevious messageNext messageBottom of page Link to this message

rgnelson
Moderator
Username: rgnelson

Post Number: 1376
Registered: 06-2003
Posted on Tuesday, June 22, 2010 - 04:07 pm:   

You must have some coefficients wrong. You've got velocities like 5e-9 and a cylinder diameter of 40, so it will take 8e9 time units for the flow to cross the cylinder. Your MONITORS statement restricts timesteps to 0.1, so it will take 8e10 timesteps to flow across the cylinder.
Top of pagePrevious messageNext messageBottom of page Link to this message

hof
Member
Username: hof

Post Number: 4
Registered: 06-2010
Posted on Thursday, June 24, 2010 - 12:19 pm:   

So i had the simulation running fairly well, but i was seeing concentration of A coming from the upstream side partway through the simulation. I changed some things, and now the program is running into a too small time-step error. Could you look at the boundary conditions and equations that i have set up and find an error? Im hoping that species A will just leave the downstream side of the channel, and that i will see a trail of A from the circle in the middle to the back end.
application/octet-streamflow and diffusion
MIMIC_whole_radial_channel_3.pde (8.8 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

rgnelson
Moderator
Username: rgnelson

Post Number: 1378
Registered: 06-2003
Posted on Thursday, June 24, 2010 - 01:47 pm:   

1) You have NATURAL(vx)=vx0. This requires visc*dx(vx)=vx0, which makes no sense. I think you wanted VALUE(vx)=vx0.

2) You still have velocities of 1e-9, which is much too small to affect the diffusion of A. If you multiply the velocities by 1e9, you will see the A material blowing away from the cylinder. Check your coefficients.

3) The print time of 0.1 holds the timestep down. It will run much faster if you allow the timestep to grow.

See attached.
mimic_3a.pde does the things mentioned above.
mimic_3b.pde freezes the velocities, since they are unaffected by A.

application/octet-stream
MIMIC_3a.pde (8.9 k)

application/octet-stream
MIMIC_3b.pde (8.6 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

hof
Member
Username: hof

Post Number: 5
Registered: 06-2010
Posted on Thursday, June 24, 2010 - 03:18 pm:   

ok, those things worked. i am still seeing concentration starting at the upstream side of my model after it has been running for a while. Also, the values for concentration there start to shoot up to a scale of e10 why is that happening?
application/octet-streamsteady state
MIMIC_flow_SS_3.pde (8.2 k)
application/octet-streamdiffusion
MIMIC_whole_radial_channel_4.pde (8.4 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

rgnelson
Moderator
Username: rgnelson

Post Number: 1380
Registered: 06-2003
Posted on Friday, June 25, 2010 - 04:41 pm:   

1) The NATURAL BC constrains only the slope and not the value of A at the inlet boundary.
Oscillations in boundary velocities can create inflow values of A through the advection terms.
A more restrictive and physically more correct BC would be VALUE(A)=0. This is stable.

2) Your initial flow computation is reporting oscillatory outflow velocities. This is because uniform velocity across the outlet plane, matched to a zero velocity at the sidewall, is non-physical. The true velocity distribution in a free channel is parabolic. If you impose a parabolic outflow velocity, you will get cleaner answers. Alternatively, you could put a short length of NATURAL(vx)=0 on the sidewalls to allow a transition from Vx0 to 0 along the wall.

See attached.

application/octet-stream
MIMIC_3c.pde (8.4 k)

application/octet-stream
MIMIC_SS_3a.pde (8.3 k)

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration