Negative values Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Negative values « Previous Next »

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

Augusto (cdfx)
Member
Username: cdfx

Post Number: 9
Registered: 04-2007
Posted on Thursday, June 07, 2007 - 08:27 pm:   

Hi Mr. Nelson

I receiving negative values for this experiment (in theory this is not correctly).

The experiment consist in plates parallel bars with a viscou fluid between.

Exist an analytical solution for this problem, but I can't obtain.

Other question is how I make the scalar value inside of the solid bars (in x y x) equal to zero?

Thanks again Mr. Nelson

TITLE 'Bars 3D'

COORDINATES cartesian3

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

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

DEFINITIONS { parameter definitions }
LIx = 0.0
LIy = 0.0
LSx = 3.0
LSy = 3.0
RPT = 2

dens = 1.0
visc = 0.001
penalty = 1.0
Pin = 0.001

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
SURFACE 'A-INI' z = 0.0
LAYER 'LA'
SURFACE 'A-FIN' z = 1.0

LAYER 'LB'
SURFACE 'B-FIN' z = 2.0

LAYER 'LC'
SURFACE 'C-FIN' z = 3.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

! FIELD 1

LIMITED REGION 2
LAYER 'LA' VOID
LAYER 'LC' VOID
REPEAT i = 0 TO RPT
REPEAT j = 0 TO RPT
START (0.0 + i, 0.3333333333333333 + j)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
LINE TO (1.0 + i, 0.3333333333333333 + j) TO (1.0 + i, 0.3333333333333333 + 0.3333333333333333 + j) TO (0.0 + i, 0.3333333333333333 + 0.3333333333333333 + j) TO CLOSE
ENDREPEAT
ENDREPEAT

! FIELD 2

LIMITED REGION 3
LAYER 'LB' VOID
REPEAT i = 0 TO RPT
REPEAT j = 0 TO RPT
START (0.0 + i, 0.3333333333333333 + j)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
LINE TO (1.0 + i, 0.3333333333333333 + j) TO (1.0 + i, 0.3333333333333333 + 0.3333333333333333 + j) TO (0.0 + i, 0.3333333333333333 + 0.3333333333333333 + j) TO CLOSE
ENDREPEAT
ENDREPEAT

! FIELD 3

LIMITED REGION 2
LAYER 'LC' VOID
REPEAT i = 0 TO RPT
REPEAT j = 0 TO RPT
START (0.0 + i, 0.3333333333333333 + j)
value(vx)=0 value(vy)=0 value(vz)=0 natural(p)=0
LINE TO (1.0 + i, 0.3333333333333333 + j) TO (1.0 + i, 0.3333333333333333 + 0.3333333333333333 + j) TO (0.0 + i, 0.3333333333333333 + 0.3333333333333333 + j) TO CLOSE
ENDREPEAT
ENDREPEAT

monitors
GRID(x,y,z)
vector(vx,vy) on z = 1
vector(vx,vy) zoom(1.0, 1.0, 1.0, 1.0) on z = 1
vector(vy,vz) on x = 1
vector(vz,vx) on y = 1
contour(vx) on z = 1
contour(vy) on x = 1
contour(vz) on y = 1

plots
GRID(x,y,z)
VECTOR(vx,vy) zoom(1.0, 1.0, 1.0, 1.0) ON z = 1 points = 70 export format "#1,#2" file "field_2d.txt"
! VECTOR(k*grad(vy)) zoom(1.0, 1.0, 1.0, 1.0) ON x = 0 points = 70 export format "(#x,#y) = (#1,#2)" file "FIELD_YZ.TXT" as "Vector Field YZ"
! VECTOR(k*grad(vz)) zoom(1.0, 1.0, 1.0, 1.0) ON y = 0 points = 70 export format "(#x,#y) = (#1,#2)" file "FIELD_XZ.TXT" as "Vector Field XZ"
! TABLE(dx(vx), dy(vy), dz(vz)) zoom(2.0, 2.0, 2.0, 1.0, 1.0, 1.0) points = 70 format "(#x, #y, #z) = (#1, #2, #3)" file "FIELD_XYZ.TXT"
TABLE(dx(vx), dy(vy), dz(vz)) zoom(1.0, 1.0, 1.0, 1.0, 1.0, 1.0) points = 70 format "#1 #2 #3" file "field_3d.txt"

vector(vx,vy) on z = 1
vector(vy,vz) on x = 1
vector(vz,vx) on y = 1
contour(vx) on z = 1
contour(vy) on x = 1
contour(vz) on y = 1
end
Top of pagePrevious messageNext messageBottom of page Link to this message

Augusto (cdfx)
Member
Username: cdfx

Post Number: 10
Registered: 04-2007
Posted on Thursday, June 07, 2007 - 08:58 pm:   

Ops the paragraph

"Exist an analytical solution for this problem, but I can't obtain."

Is wrong, sorry!

I can't generate the numerical values to compare with analytical solution!

Thanks again!
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 878
Registered: 06-2003
Posted on Friday, June 08, 2007 - 12:28 am:   

1.
The only negative numbers I see are in Vy, which is nominally zero. These are simply numerical noise, four orders of magnitude below the dominant flow velocities. This is a numerical approximation, after all, not an analytic solution, and on a very crude mesh at that.

2.
Your four slabs are all disjoint. There is no point in running them all together; it just creates a larger mesh and runs longer. You can do each one individually.

3.
If "the space between the bars" you refer to is the gaps between slabs, then they are already zero, because you excluded them. If you mean to stop the flow in the mid section of each slab, just exclude that as well.

4.
If you are using the student version, it won't work. You need more nodes than the student version allows. Try running the individual slabs.



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