I want to run a simulation of acoustic waves produced by two arrays of transducers facing each other (check 'transducers.PNG'), in 2d. So, basically I have one array of transducers on bottom facing an array on top, each array consists of 16 transducers and each transducer can produce a specific acoustic wave. Geometry and mesh is created with a python script in Salome, then converted from .unv to the right elmer format. I have assigned different boundaries ("edges" in 2d) and bodies to correctly perform the simulation. The idea is that for each boundary (i.e. in 'boundary.PNG' the boundary that produces the corresponding acoustic wave for the transducer on bottom left highlighted in red, each transducer is represented by a square of proper dimensions and gaps in between the transducers) I assign a different boundary condition. So, there are 32 boundary conditions in total, that are generated by a python script that writes the .sif file (for obvious reasons). Each transducer produces the same wave (in amplitude and frequency) with a phase delay. Below you can find a code snippet:
Code: Select all
$ phases(0:31) = 3.4739563 1.28130899 4.92668337 1.79103825 4.38841548 0.10363855 1.46155566 2.1485715 2.1485715 1.46155566 0.10363855 4.38841548 1.79103825 4.92668337 1.28130899 3.4739563 3.4739563 1.28130899 4.92668337 1.79103825 4.38841548 0.10363855 1.46155566 2.1485715 2.1485715 1.46155566 0.10363855 4.38841548 1.79103825 4.92668337 1.28130899 3.4739563
Boundary Condition 1
Target Boundaries(1) = 2
Name = "TD1"
Plane Wave BC = True
$ p0 = 1.0
$ k = 1.0
Pressure Wave 1 = Variable Coordinate
Real MATC "p0*cos(k*tx(1) + phases(0))"
Pressure Wave 2 = Variable Coordinate
Real MATC "p0*sin(k*tx(1) + phases(0))"
Wave Impedance 1 = $c0 * rho0
End
Boundary Condition 2
Target Boundaries(1) = 3
Name = "TD2"
Plane Wave BC = True
$ p0 = 1.0
$ k = 1.0
Pressure Wave 1 = Variable Coordinate
Real MATC "p0*cos(k*tx(1) + phases(1))"
Pressure Wave 2 = Variable Coordinate
Real MATC "p0*sin(k*tx(1) + phases(1))"
Wave Impedance 1 = $c0 * rho0
End
... and so on
1) Obviously, it doesn't work at all, even though that the simulation is already tested in Matlab & Comsol and it works fine.
2) I only get 'pressure wave' instead of 'pressure wave 1' and 'pressure wave 2' in ParaView. You can find the whole .sif file below.