Problem with amount of nodes Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Problem with amount of nodes « Previous Next »

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

Ole Tar (oletar)
New member
Username: oletar

Post Number: 1
Registered: 05-2007
Posted on Tuesday, May 08, 2007 - 04:54 am:   

Dear Sir,

I'm a novice in FlexDDE. I'm trying to solve a problem related to the movement of sodium ions in glass under applied high voltage. It seems that the program (see text below) requires a huge amount of nodes, and I cannot solve it on my Pentium 4, 2 Ghz, 512 Mb RAM notebook. Could you help me to introduce some trick to decrease the number of nodes.

Thanks,
oletar

TITLE
'Electric field and Na+ ion distribution: in a fiber with hole'
SELECT
errlim=1e-3
SMOOTHINIT = ON

VARIABLES
U NNa NO
DEFINITIONS
r0=62.5e-6 a=25e-6 b=15e-6 {dimensions, mkm}
U_el=5000 {Applied voltage, V}
mueNa=1e-15 {mobility of sodium ions}
kb=1.38e-23
Temper=523
q=1.6e-19 eps=3.78 eps0=8.854e-12
Ni=8e21 {initial concentration of sodium ions}
mueNO=0


mesh_spacing=1e-6

Ex=-dx(U) Ey=-dy(U)
E=-grad(U) Em=magnitude(E)

INITIAL VALUES
NNa=ramp(sqrt(x**2+(y+25e-6)**2)-15e-6-0.5e-6,0,Ni,1e-6)
NO=ramp(sqrt(x**2+(y+25e-6)**2)-15e-6-0.5e-6,0,Ni,1e-6)
U=0

EQUATIONS
U: div(grad(U))=-(q/(eps*eps0))*(NNa-NO)
NNa: dt(NNa)=(mueNa*kb*Temper/q)*div( grad( NNa))+mueNa*DOT(grad(NNa),grad(U))-mueNa*NNa*(q/(eps*eps0))*(NNa-NO)
NO: dt(NO)=0

BOUNDARIES

region 'fiber'

start 'electrode_2' (b,-a) value(U)=U_el*(1-exp(-5*t))**1 arc( center=0,-a) angle=360
start 'perimeter' (r0,0) value(U)=0 arc( center=0,0) angle=360


feature { a "gridding feature" to help localize the activity }
start (0.02e-6,-a) arc( center=0,-a) angle=360


TIME from 0 to 100
FRONT(NNa-Ni/2,8e21)


PLOTS

for t=0 by 1 to 100
contour( U) painted
contour( NNa) painted !surface( NNa)
!contour( Em) painted surface( Em)
elevation( NNa,-NO,NNa-NO) from (0,-10e-6) to (0,10e-6)
elevation( U) from (0,-10e-6) to (0,10e-6)
elevation( Ey) from (0,-10e-6) to (0,10e-6)
!elevation( Em) on 'electrode_1' elevation( Em) on 'electrode_1'
!vector( E) norm
END
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 844
Registered: 06-2003
Posted on Tuesday, May 08, 2007 - 09:44 pm:   

You have defined MESH_SPACING=1e-6.
It takes about 25,000 cells to fill your figure with cells this size. If you don't want that many, don't ask for them.

Because you have a very steep front propagating from the central hole, you should probably retain your MESH_SPACING=1e-6, but move it to a point after "Start 'electorde+2' (b,-a)"
This will apply the mesh control only on the boundary of the hole, and not throughout the domain.

Also, NO is unchanging (dt(NO)=0), so there is no point in treating it as a variable. Move the definition of NO to the DEFINITIONS section.

Your "Feature" seems to be inside the inner circle, and is excluded, so you might as well remove it.

With these changes, your problem runs with about 5000 nodes and uses about 18MB RAM.

It still runs quite slowly, but this is probably because of the exponential shape imposed on U and the nonlinearity of the system.

Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 845
Registered: 06-2003
Posted on Tuesday, May 08, 2007 - 09:49 pm:   

PS
The problem seems to run much more quickly with some hysteresis on U.
I used for the U equation
U: dt(U) = div(grad(U))-(q/(eps*eps0))*(NNa-NO)
I don't know if this affects the solution.

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