CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Accelerate the assembling of 3D convection matrix

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 22, 2005, 08:52
Default Accelerate the assembling of 3D convection matrix
  #1
Isabel
Guest
 
Posts: n/a
Hello everybody,

I have to solve 3D time dependent Navier Stokes equations with finite element method.

There are 68921 nodes and in each node I have to calculate velocity field (u,v,w) and pressure (p).

After every time step I have to calculate the convection (or advection) matrix because the velocity field has changed and, the assembling of this convection matrix takes a lot of time, more than solve the velocity system and the pressure system (I work with a decoupled method). Could someone give me an advice to accelerate its computation?.

Thank-you very much, best regards and Merry Christmas! Isabel
  Reply With Quote

Old   December 22, 2005, 09:02
Default Re: Accelerate the assembling of 3D convection mat
  #2
Márcio Ricardo
Guest
 
Posts: n/a
If you're working with an explicit method, you can use the following aproximation:

x direction: Conv(u,v,w) = Grad_x(u*u) + Grad_y(v*u) + Grad_z(w*u)

and so on for the y- and z- directions. This way you would have a geometric matrix for the convective term

regards

Márcio
  Reply With Quote

Old   December 22, 2005, 09:25
Default Re: Accelerate the assembling of 3D convection mat
  #3
Renato.
Guest
 
Posts: n/a
Hy Isabel,

Why don't you try to use element-by-element (EBE) data structure and avoid the need to assembly your matrices?

It's very simple to implement and use and you'll cut a lot of time and memory storage.

By the way, are you using iterative or direct linear solver? I'm asking for that because if you're using an iterative solver you'll need to implement a specific matrix-vector routine to compute it in an EBE way. But it's also easy to do...

Cheers and Merry Christmas!

Renato.

  Reply With Quote

Old   December 22, 2005, 11:21
Default Re: Accelerate the assembling of 3D convection mat
  #4
diaw
Guest
 
Posts: n/a
A neat trick we use is that of assembling using 'tensor' forms instead of 'matrix' forms. This often seems to vectorise rather well under the compiler.

diaw...
  Reply With Quote

Old   December 22, 2005, 11:55
Default Re: Accelerate the assembling of 3D convection mat
  #5
Renato.
Guest
 
Posts: n/a
When using element-by-element (or edge-by-edge) data structures we can reach vectorization (or OpenMP parallelism) after applying some kind of mesh coloring algorithm. In this case, the elements (or edges) are reordered and grouped in such a way that none of the elements inside a group/block share the same node.

Regards

Renato.
  Reply With Quote

Old   December 22, 2005, 12:41
Default Re: Accelerate the assembling of 3D convection mat
  #6
Isabel
Guest
 
Posts: n/a
Hi!

I am using an iterative method to solve the momentum equation. Renato, could you give any references where the EBE scheme and matrix-vector method are explained and that explains how not assembling the nonlinear convection term, i.e. <u*gradu,v> (in Finite Element Method nomenclature)? I would be really greatful.

Thank-you. Isa
  Reply With Quote

Old   December 22, 2005, 13:22
Default Re: Accelerate the assembling of 3D convection mat
  #7
Renato.
Guest
 
Posts: n/a
The idea behind EBE data structure is not so complicated to understand and I'll try to sketch something here:

* * * STORING THE MATRIX * * *

- Imagine you have a mesh with a mesh formed by triangles with 1 degrees of freedom per node. In order to build your "stiffness" matrix you'll have to perform a loop over the elements computing the contributions of the mass, convective, diffusive terms, etc... . Thus, instead of assembling the coefficients you'll store each element matrix separately to use later inside the iterative solver for the matrix-vector product. Therefore, you'll need an array like the following:

A(nnoel*ngl, nnoel*ngl, nel) (instead of A(neq,neq) in a assembled solution)

where: nel is the number of elements, nnoel is the number of nodes per element (3 for linear triangles), ngl is the number of degrees of freedom (1 in this example) and neq the number of active equations.

- The vector force will remain by neq as you're used in your assembled solution.

* * * USING THE EBE FOR MATRIX-VECTOR PRODUCT * * *

- In order to perform the matvec product in your iterative solver see the following pseudo-code:

z <-- A*x

DO i=1,nel

c. recover number of equations from your connectivity matrix (IEN)

c. recover local vector force coefficients (from x)

c. recover element-based stiffness coefficients (from A)

c. multiply your element gathered matrix and vector (A*x)

c. scatter your multiplication (in z)

ENDDO

I've found the following link where Marek Behr discusses EBE related issues

http://www.cats.rwth-aachen.de:8080/pdf/para-l21.pdf

Cheers

Renato
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convection with Shell Conduction Corentin FLUENT 7 January 30, 2012 14:12
natural convection problem with radiation jorien CFX 0 October 14, 2011 09:26
Force can not converge colopolo CFX 13 October 4, 2011 22:03
OpenFOAM version 1.6 details lakeat OpenFOAM Running, Solving & CFD 42 August 26, 2009 21:47
Coupled vs Seg - Natural vs. Forced Convection Alex CD-adapco 5 December 12, 2007 05:58


All times are GMT -4. The time now is 13:55.