Surface Problems Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Surface Problems « Previous Next »

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

Augusto (cdfx)
Member
Username: cdfx

Post Number: 14
Registered: 04-2007
Posted on Wednesday, August 01, 2007 - 12:49 am:   

Hi Mr. Nelson

I canīt understand why FlexPDE is reporting a error of tangled surfaces.

Follow the code

Thanks Mr!

TITLE 'Blocks'

COORDINATES cartesian3

VARIABLES
vx(1e-6) vy(1e-6) vz(1e-6) p

SELECT { method controls }
ngrid = 10
errlim = 0.001
stages = 1
regrid = off

DEFINITIONS { parameter definitions }
LIx = -1.0
LIy = -1.0
LSx = 2.0
LSy = 2.0

dens = 1.0
visc = 0.01
penalty = 100.0

Pin = 0.1875

INITIAL VALUES
vx = 0 vy = 0 vz = 0 p = Pin

EQUATIONS
vx: div(grad(vx)) - dx(p)/visc = dens*(vx*dx(vx) + vy*dy(vx) + vz*dz(vx))/visc
vy: div(grad(vy)) - dy(p)/visc = dens*(vx*dx(vy) + vy*dy(vy) + vz*dz(vy))/visc
vz: div(grad(vz)) - dz(p)/visc = dens*(vx*dx(vz) + vy*dy(vz) + vz*dz(vz))/visc
p: div(grad(p)) = penalty * (dx(vx)+dy(vy)+dz(vz))

! CONSTRAINTS { Integral constraints }

EXTRUSION Z = -1.0, -0.8, -0.2, 0.2, 0.8, 1.2, 1.8, 2.0

BOUNDARIES
REGION 1
START(LIx, LIy)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0

LINE TO (LSx, LIy)
natural(vx)=0 natural(vy)=0 natural(vz)=0 value(p)=-Pin

LINE TO (LSx, LSy)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0

LINE TO (LIx, LSy)
natural(vx)=0 natural(vy)=0 natural(vz)=0 value(p)=Pin

LINE TO CLOSE

REPEAT j = -1 by 1 to 1
REPEAT i = -1 by 1 to 1
LIMITED REGION 2
surface 1 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 2 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 3 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 4 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 5 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 6 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 7 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 8 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
LAYER 1 VOID
LAYER 3 VOID
LAYER 5 VOID
LAYER 7 VOID
START(0.0 + i, 0.0 + j)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
LINE TO (0.4 + i, 0.0 + j)
TO (0.4 + i, 0.4 + j)
TO (0.0 + i, 0.4 + j)
TO CLOSE
START (0.6 + i, 0.0 + j)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
LINE TO (1.0 + i, 0.0 + j)
TO (1.0 + i, 0.4 + j)
TO (0.6 + i, 0.4 + j)
TO CLOSE
START (0.6 + i, 0.6 + j)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
LINE TO (1.0 + i, 0.6 + j)
TO (1.0 + i, 1.0 + j)
TO (0.6 + i, 1.0 + j)
TO CLOSE
START (0.0 + i, 0.6 + j)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
LINE TO (0.4 + i, 0.6 + j)
TO (0.4 + i, 1.0 + j)
TO (0.0 + i, 1.0 + j)
TO CLOSE

LIMITED REGION 3
surface 2 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 3 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 4 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 5 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 6 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
surface 7 value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
LAYER 2 VOID
LAYER 4 VOID
LAYER 6 VOID
START (0.2 + i, 0.2 + j)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
LINE TO (0.8 + i, 0.2 + j)
TO (0.8 + i, 0.8 + j)
TO (0.2 + i, 0.8 + j)
TO CLOSE
ENDREPEAT
ENDREPEAT

monitors
GRID(x,y,z)
VECTOR(vx,vy) zoom(0.0, 0.0, 1.0, 1.0) ON z = 0.5
CONTOUR(vx) zoom(0.0, 0.0, 1.0, 1.0) ON z = 0.5
vector(vx, vz) zoom(0.0, 0.0, 1.0, 1.0) ON y = 0.5

plots
GRID(x,y,z)
VECTOR(vx,vy) zoom(0.0, 0.0, 1.0, 1.0) ON z = 0.5 points = 70 export format "#1 #2" file "block2d.vec"
TABLE(vx, vy, vz) zoom(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) points = 70 format "#1 #2 #3" file "block3d.vec"

VECTOR(vx,vy) zoom(0.0, 0.0, 1.0, 1.0) ON z = 0.5
CONTOUR(vx) zoom(0.0, 0.0, 1.0, 1.0) ON z = 0.5
vector(vx, vz) zoom(0.0, 0.0, 1.0, 1.0) ON y = 0.5
end
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 923
Registered: 06-2003
Posted on Wednesday, August 01, 2007 - 02:11 pm:   

There are two problems here, caused by a misunderstanding of how FlexPDE constructs 3D extrusion models.

1.
If you start at a point in the (X,Y) projection plane and run a vertical line up through the figure, the line will encounter a sequence of materials. In any REGION, the sequence of materials thus encountered must be the same. That is, there must be as many REGIONS as there are different material patterns on the vertical lines.
In your case, there are three different patterns: 1) the on-off pattern of the grid arms, 2) the off-on pattern of the square corners, and 3) the on-on pattern of the square centers.
Each of these must be a separate region.

2.
A REPEAT is a text expansion process. When your REPEATS are expanded, it will result in a sequence:
Region 2
Region 3
Region 2
Region 3
...
etc.
Each of these REGION statements will become a separate region tabulation internally, regardless of the label you have put on it.

In any surface, regions declared later will hide any region declared earlier, if they overlap.
In your case, region "3" will overlap and hide some instances of region "2". The reverse will also be true in other parts of the domain.

You should put the REPEAT inside the REGION definitions, not outside. If you do that, you will get only one set of REGION 2 patches and one set of REGION 3 patches, instead of eighteen different REGIONs.

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