Skip to content

Structure_of_NC.inp

Fabian Brinkmann edited this page Jul 15, 2022 · 1 revision

Introduction

The Mesh2HRTF Project Folder contains the input file Nc.inp that stores all parameters that are required to start a NumCalc calculation. The input file is automatically generated, but it is possible to manually generate new and alter existing input files. This section thus describes the structure of the input file.

Lines starting with # are interpreted as comments and are ignored. In the follwong [%s] denotes that the input should be a string, [%d] an integer, [%f] a float or a double. Not all features (f.e. the CURVE - definitions) have been used very often, so there is the very slight possibility, that there is a bug still hidden, that we have not found yet.

NC.inp

#Identifier and Versionnumber: [%s]

Currently not used. The version number is intended to provide downward compatibility of the code in the future

#Problemname [%s]

Name of the problem

#Controlparameter I [%d]

Currently not used. In the future this line may contain flags for new features like, CHIEF points, unit system, ...

#Controlparameter II [%d %d %f %f]

These parameters are used to define the frequencies for the calculation. In general, frequencies for NumCalc are defined using a frequency curve. The main parameters for the curve definition are

  1. Dummyparameter
  2. Number of frequency steps
  3. Stepsize (see below)
  4. First frequency

For example:

## Controlparameter II
1 3 0.000001 0.00e+00 1 0 0

#Frequency Curve:

%d %d %f %f ... %f %f The first line defines the number of the curve and the number of points used to define the curve. The next lines define the piece wise linear frequency curve. For example:

## Load Frequency Curve
0 4
0.000000 0.000000e+00 0.0
0.000001 0.010000e+04 0.0
0.000002 0.020000e+04 0.0
0.000003 0.030000e+04 0.0

This means that the frequency curve will be evaluated at the three positions [0.000001 0.000002 0.000003]. Together with the definition of the frequency curve the frequencies of interest are given by: 100, 200, and 300 Hz. The definition of the start is a bit odd, because the first frequency is given by start + frequency step not by start. So why are there some additional 0.0 lines in the frequency curve. Actually, you don’t need them, NumCalc reads all the necessary parameters in each line, and disregards the rest, so you can write whatever you want then. The 0.0 in the example a left overs of from input files from the good old days.

#Main Parameters I [%d %d %d %d %d %d %d %d]

  1. Number of element groups. Elements can be collected into different element groups in order to structure the output. In general we will have two element groups: object elements and evaluation elements around the head. Also the current ncdata2vtk.m script that can be used to graphically display the results, assumes that only the above mentioned two groups exist.
  2. Number of elements in the object mesh plus the number of elements of the evaluation mesh
  3. Number of nodes including the number of nodes of the evaluation mesh
  4. Min. Number of Expansion Terms in the FMM. In general, the number of expansion terms for the FMM is dependent on frequency and size of the clusters used for the FMM and calculated automatically. However, to enhance the stability of the FMM, especially at low frequency, it is possible to set a a minimum number of terms used. If this value is 0 then per default at least 8 expansion terms are used in the FMM.
  5. Number of symmetric planes. For symmetric meshes it may be useful and more efficient to only define parts of the mesh and construct the rest of the mesh by mirroring at symmetric planes. It is possible to use planes normal to the x-, y , and z-axis or combination of those 3. The type of planes and the type of mirroring is defined later below using the keyword SYMMETRY. Warning: If this option is used everything is mirrored, including mesh data, boundary conditions and external sound sources.
  6. Currently not used.
  7. Currently not used.
  8. BEM Method. The method we are using to solve the BIE • 0 = traditional BEM • 1 = single level FMM • 4 = multilevel FMM We have to note, that the transformations between the different levels of the multi- pole method are not done using the FFT but they are calculated before and stored into transformation matrices. This has the advantage that the calculations are a bit faster with just a few more memory requirements.
  9. Solver used for the linear system • 0 = CGS iterative solver • 4 = Gauss elimination To that end we have to point out, that the direct solver is implemented by a simple LU-decomposition and simple back-substitution. In the future LAPACK routines, which are faster shall be implemented. For the FMM the iterative solver is auto- matically used.

#MainParameters II [%d %d %d %d %d]

  1. Number of incident plane waves
  2. Number of external point sources
  3. Flag if the problem of interest is an interior or an exterior problem
  4. Length of each cluster edge. If 0 is given, then the clusters are calculated automati- cally.
  5. Preconditioner. Type of preconditioning used in the iterative solver • 0 = incomplete LU (see also Andreas Meister: Numerik linearer Gleichungssys- teme. Eine Einführung in moderne Verfahren , 1999) • 1 = row scaling (see also Andreas Meister: Numerik linearer Gleichungssysteme. Eine Einüfhrung in moderne Verfahren , 1999) • 2 = no preconditioning

#Main Parameters III [%d]

Currently not used

#Main Parameters IV [%f %f %f]

Parameters describing the propagation medium

  1. Speed of sound in [m/s]
  2. Density of the medium
  3. Harmonic time factor of the solution

#NODES [%s ... %s]

File names of the nodal data of BEM and eval mesh is given

#ELEMENTS [%s ... %s]

File names of the element data of BEM and eval mesh is given

#SYMMETRY

%d %d %d %f %f %f May only be used if a number for symmetric planes have been given in #Main Parameters I. Definition of the symmetry planes and the type of the symmetry.

  1. Type of the symmetry plane normal to the x-axis • 0: none • 1: symmetric plane (sound hard) • 2: anti-symmetric plane (sound soft) • 3: hard reflecting (see 1) • 4: soft reflecting (see 2)
  2. Symmetry plane normal to y-axis
  3. Symmetry plane normal to z-axis
  4. x,y,z coordinates of the point where the plane intersects the axis Example:
SYMMETRY
1 0 0
0.0000e+00 0.0000e+00 0.0000e+00

sets the symmetry plane normal to the x axis at the origin.

#BOUNDARY : ELEM [%d] TO [%d %s %f %d %f %d]

  1. Keyword ELEM
  2. Index of first Element to which the boundary condition applies
  3. Keyword TO
  4. Index of last element to which the boundary condition applies
  5. Keyword • VELO: velocity boundary condition • PRES: pressure boundary condition • ADMI: admittance boundary condition • IMPE: impedance boundary condition
  6. Real part of b.c.
  7. Curve number for th e real part. It is possible to defined boundary conditions dependent on the frequency. To that end it is possible to define a piece wise linear curve similar to the frequency curve. Curve number gives the number of the frequency curve, that has to be defined below like the frequency curve. A value of -1 means no curve is defined and all values are constant over all frequency steps
  8. Imaginary part of the b.c.
  9. Curve number for the imaginary part.

Multiple lines can be used and the BOUNDARY section must be closed with RETU. BOUNDARY and RETU must be provided.

The specification of the imaginary part is not required

If no entry is given sound hard boundary conditions for all elements are assumed, thus missing entries are equivalent to FROM FirstElement TO LastElement VELO 0.0 -1 0.0 -1

Examples:

ELEM 1 TO 10 PRES 1.0 -1 1.0 -1

sets a pressure boundary condition of p = 1 + i at elements 1 to 10 and the rest of the elements have a velocity (neumann) boundary condition set to zero.

#PLANE WAVES [%d %f %f %f %d %f %d %f]

Only applicable if the number of plane waves is bigger than zero. (see MainParameters II). For each source a line must be given

  1. Number of the plane wave
  2. x-direction of the plane wave
  3. y-direction of the plane wave
  4. z-direction of the plane wave
  5. Real part of the strength
  6. Curve number. As the boundary condition the strength of the plane wave can be defined dependent on the frequency step using a curve. See above
  7. Imaginary part of the strength
  8. Curve number: See above The definition of the frequency step dependent curves have not been fully tested yet. Example:
PLANE WAVES
0 0.0000e+00 -1.0000e+00 0.0000e+00 1.0000e-4 -1 0.0000e+00 -1

defines a plane wave in the direction of [0 -1 0] with a strength of 1.0 · 10−4 + 0.0i.

#POINT SOURCES: [%d %f %f %f %f %d %f %d]

Only applicable if the number of point sources is bigger than zero. (see MainParameters II) For each source the a line must be given.

  1. Number of the source
  2. x-coordinate of the source
  3. y-coordinate of the source
  4. z-coordinate of the source
  5. Real part of the strength
  6. Curve number. As the boundary condition the strength of the plane wave can be defined dependent on the frequency step using a curve. See above
  7. Imaginary part of the strength
  8. Curve number: See above Example:
POINT SOURCES
0 1.5 -1.5 0.0 0.1 -1 0.0 -1

defines a point source at [0 1.5 -1.5] with a strength of 0.1 + 0.0i. The strength S is defined via p(R) = Se^{ikR}{R}, where R is the distance from the origin of the point source and p(R) is the sound pressure at this distance. Please note, that with this definition there is a frequency dependence implicitly hidden in the definition. Remember, the velocity potential(Greens function in) for a point source in 3D is given as G(R) = eikR /R and the pressure is iρωG(R), where ω = 2πf and ρ is the density of the propagation medium. So, if your results scale with the frequency this could be the reason.

#CURVES\ [%d %d]:

Optional definition of the piece wise linear curves for BOUNDARY, PLAIN WAVES, and POINT SOURCE curves.

NOTE: Frequency dependent boundary conditions can only be specified for ADMI and IMPE but not for PRES and VELO

  1. Number of defined curves
  2. Maximum number of steps of the curves
  3. Curve definitions [%f %f] (slightly different than above!)
    1. Frequency in Hz
    2. Value at the frequency

Only applicable if curve numbers are provided in the BOUNDARY, PLAIN WAVES, and POINT SOURCE sections. As the number of steps and the step size of the frequency steps have been already defined for the frequency curve, here only the curves themselves have to be defined.

Example:

BOUNDARY
ELEM 0 TO 2411 ADMI 1.0 1 1.0 2
RETU
.
.
.
CURVES
2 3
1 3
0.000000e+00 0.000000e+00 0.0
0.100000e+04 1.000000e+00 0.0
0.200000e+04 2.000000e+00 0.0
2 3
0.000000e+00 0.000000e+00 0.0
0.100000e+04 0.000000e+00 0.0
0.200000e+04 0.000000e+00 0.0

This defines the following admittance:

  • 0 + 0j at 0 Hz
  • 1 + 0j at 1 kHz
  • 2 + 0j at 2 kHz

Note: The final admittance vales above are internally calculated by multiplying the frequency independent values from the line ELEM 0 TO 2411 ADMI 1.0 1 1.0 2 with the values defined in the curve. E.g., the value at 1 kHz is obtained as follows: 1*1 + 1*0j.

Note : This is a piece wise linear definition which is linearly interpolated to obtain values at the desired frequncies. E.g., a value of 0.5 + 0j would be obtained at 500 Hz.

**This feature has not been fully tested yet. **

POST PROCESS

Dummy, not needed yet

END

finishes the definition of the input file

Clone this wiki locally