problem with scalar variable that cha... Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » problem with scalar variable that changes over time « Previous Next »

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

Britta Hagmeyer (britta)
Member
Username: britta

Post Number: 9
Registered: 11-2006
Posted on Wednesday, April 25, 2007 - 01:06 pm:   

Hello everyone!
I have a question concerning a time-dependent problem with a scalar variable that changes over time:

The 3D-system models the particle transport from a droplet through a porous membrane into a fluid. The droplet is not being modeled, and the particle influx into the system through a source in the bottom (with a NATURAL boundary condition) is being calculated by Fick's first law and the law of Hagen-Poiseuille (converted into flux).

For the calculation of the particle flux according to the law of Hagen-Poiseuille, a pressure difference is needed. This difference is being calculated via the surface tension of the droplet and the curvature angle of the droplet, which is being calculated via the droplet's volume. Through the volume influx from the droplet into the fluid the droplet's volume changes over time, and each time step the calculations should be done with the new updated droplet volume. (Meaning: Volume(t+1) = Volume(t) - Volume change) How can this be done in FlexPDE? I need some kind of recursion loop... I've tried to use a GLOBAL VARIABLE, but I seem to not quite understand the use of it... As the system is now, the volume does change over time, but not as it is supposed to.

Which equations are needed in order to get the desired results?? How does the GLOBAL VARIABLE work? How can I implement a recursion into the FlexPDE file?

I have attached the code. I hope you can help me!

Thanks a lot!
Cheers,
Britta
application/octet-streamproblem code
c+d_forum.pde (4.3 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 830
Registered: 06-2003
Posted on Thursday, April 26, 2007 - 02:27 pm:   

In principle, what you have done is correct, with two exceptions:

1) Your GLOBAL VARIABLE "vol" has a value of approximately 2e-14, but you have given it an error THRESHOLD of 0.1. This means that the value of "vol" will have to bounce by thirteen orders of magnitude before the timestep control will pay any attention to it. Put your THRESHOLD at the level you want FlexPDE to hold accuracy. I suggest 1e-15.

2) Is your defined quantity "volume" supposed to have a spatially differing value? You have given it a constant default value, and equated it to "vol" only in the small pore patch. The History plot, since it does not specify an evaluation position, reports the constant value.
I infer that you want "volume" to be a surrogate for "vol". Either move the definition "volume = vol" to the global DEFINITIONS section, or replace all uses of "volume" by "vol".
Top of pagePrevious messageNext messageBottom of page Link to this message

Britta Hagmeyer (britta)
Member
Username: britta

Post Number: 10
Registered: 11-2006
Posted on Wednesday, May 16, 2007 - 10:53 am:   

Thanks, the advice helped a lot! But now, I've got another question:

I've been tweaking with the THRESHOLD-values of the global variable vol and the variable u, and the 3D-System I've built is running smoothly with the parameters that are currently commented in in the attached FlexPDE-code. But if I change the parameters to those which are currently commented out, the system is not working properly any more: The simulation is a lot slower, and when the global variable vol reaches a negative value, there's a peak in the HISTORY plot of J and J_hp. I've tried smoothing the IF...THEN...ELSE-statement by using a SWAGE-function, but the results I get for J and J_hp when using this function are different from the results using the IF-statement. What else can I do? Have I been using the SWAGE-function properly? Where is the problem in my simulation?

Thanks a lot!

Cheers,
Britta
application/octet-streamFlexPDE model
c+d_forum.pde (4.6 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 854
Registered: 06-2003
Posted on Wednesday, May 16, 2007 - 02:57 pm:   

1) A smaller THRESHOLD will scale errors larger and cause smaller timesteps
2) You can't drive vol through zero, because you are dividing by it. When it goes through zero you will get arithmetic errors.

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