CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   1D dimension (

eddy September 1, 2000 04:04

1D dimension
This is very simple questions.

Why someone define 3D variable in 1D dimension? What is the adventage of this programming skill?

A.Hassaneen September 1, 2000 04:28

Re: 1D dimension
I think If you are using commercial code and if you can neglegt the variable's change in 2 of the 3-D space coordinates, according to the nature of the problem, then the assumption of 1-D for 3-D problem will save huge CPU time. If you are developing your code, then writing a 1-D code is much easier than 3-D code beside the CPU time. But you should make sure that the assumption will not have that much effect in the outcome of the simulation.

Steve Amphlett September 1, 2000 04:42

Re: 1D codes
1D codes are hugely popular in engine performance and noise simulation, where people routinely model complete systems from intake orifice to exhaust orifice in one continuous model. So long as you have good sub-models for Y junctions, sudden changes of area and perforates, you can get remarkably accurate results from a model with (e.g.) 1000 volumes or less. Good enough to predict volumetric efficiency to within a few percent and good enough to predict radiated intake and exhaust noise to within a few dB.

These models obviously run much faster than 3D models (e.g. full engine cycles in seconds) and are used to populate performance maps and even run coupled to ECU simulation software.

When detailed flow behaviour in a small component is desired, people replace sections of the 1D model with bits of 3D CFD.

fletcher September 1, 2000 05:00

Re: 1D dimension
Why is it so popular in modern codes for 3D problems to store 3D variables (such as velocities in x,y,z components) in an array with only one rank?

Salvador Navarro-Martinez September 1, 2000 08:13

Re: 1D dimension
Storage capacity mainly. And also speed to access. Also there is a lot of subroutines that operate with one rank arrays, if you store the 2D data and the 3D data in one rank vector, you can use the same subroutine with any change.

Hong September 1, 2000 08:50

Re: 1D dimension
1. 1D array is more appropriate for the unstructured grid 2. 1D array can save the CPU time. 3. 1D array is more appropriate for the matrix computation, for example ICCG method. 4. and go further, you can use lots of routines writen in 1D array. 5. but when you use 1D array, you'd better define all the topology in advance. 6. in my experience, one drawback of 1D array is that it is inconvieniet to make grid_based computation, such as the relationship between the coarse grid and fine grid in multigrid. ( Is it correct?) 7.1D array can make the code very neat.

Good luck

John C. Chien September 2, 2000 11:12

Re: 1D dimension
(1). In old days,(back in 60's), the CPU was very slow. (2). So, in using T(i,j,k), the compiler will have to compute the correct memory address (linear), and it takes extra time. (3). If you un-roll it into 1-D array, say T(m), with the address computed explicitly just before T(m) in the Fortran code, then you can save the overhead time for the compiler to do it for you. (4). So, in old days, this is a standard technique to improve the speed. This is a poor man's approach. (5). I think, the current version of Fortran compiler should be smart enough to optimize it for the user in this area.(I am not sure, but in many cases, the compiler is smart enough to optimize it for you, even re-write the code). (6). For applications, where you are forced to use 1-D array because of the algorithms used, then it is a completely different story.(you don't have choice there).

Hong September 3, 2000 07:24

Re: 1D dimension
I want to stress that the development of CPU is always behind the demands of numerical computation. You can never depend your computation on the speed of CPU, you have to use powerful algorithm to make your code faster and faster. In my opinoin, the so-called *high performance compuation * is partly based on this point.

Good luck

All times are GMT -4. The time now is 17:01.