11# DGFEM for Acoustic Wave Propagation
22
3- [ ![ version] ( https://img.shields.io/badge/version-1.3.5 -red )] ( https://github.com/skhelladi/DGFEM-CAA/releases/tag/v1.3.5 )
4- [ ![ compilers] ( https://img.shields.io/badge/c++-17%20|%2020-27ae60.svg )] ( https://github.com/skhelladi/DGFEM-CAA/releases/tag/v1.3.5 )
3+ [ ![ version] ( https://img.shields.io/badge/version-1.3.6 -red )] ( https://github.com/skhelladi/DGFEM-CAA/releases/tag/v1.3.6 )
4+ [ ![ compilers] ( https://img.shields.io/badge/c++-17%20|%2020-27ae60.svg )] ( https://github.com/skhelladi/DGFEM-CAA/releases/tag/v1.3.6 )
55
66This repository implements a discontinuous Galerkin finite element method (DGFEM) applied to the linearized Euler equations and the acoustic
77perturbation equations.
@@ -11,6 +11,7 @@ The solver is based on [GMSH](http://gmsh.info/) library and supports a wide ran
1111- 4-th order Runge-Kutta
1212- High order elements
1313- Absorbing and reflecting boundaries
14+ - Support 'json' format configartion file
1415- Multiple sources support: monopoles, dipoles, quadrupoles, user defined analytical formulation sources and external data (csv and sound 'wave' file supported)
1516- Complex geometry and unstructured grid (only triangles (2D) and tetrahedrons (3D) elements are supported)
1617- VTK post-processing (use [ Paraview] ( https://www.paraview.org/ ) )
@@ -58,7 +59,13 @@ Once the sources sucessfully build, you can start using with the solver. It requ
5859
5960```
6061cd bin
61- ./dgalerkin mymesh.msh myconfig.conf
62+ ./dgalerkin myconfig.conf
63+ ```
64+ or
65+
66+ ```
67+ cd bin
68+ ./dgalerkin myconfig.json
6269```
6370
6471### Minimal working example
@@ -67,7 +74,13 @@ cd bin
6774
6875```
6976cd build/bin
70- ./dgalerkin ../../doc/2d/square.msh ../../doc/config/config.conf
77+ ./dgalerkin ../../doc/config/Square.conf
78+ ```
79+ or
80+
81+ ```
82+ cd build/bin
83+ ./dgalerkin ../../doc/config/Square.json
7184```
7285
7386or configure run_caa batch file with the right mesh and configurations files.
@@ -76,8 +89,12 @@ or configure run_caa batch file with the right mesh and configurations files.
7689sh run_caa
7790```
7891## Configuration file example
92+ ### Text format file
7993<!-- python style text highlight -->
8094``` python
95+
96+ meshFileName = doc/ 2d / square2.msh
97+
8198# Initial, final time and time step(t>0)
8299timeStart= 0
83100timeEnd= 0.05
@@ -144,9 +161,118 @@ source4 = file,"data/data.wav", 0.0,0.0,0.0, 0.1
144161observer1 = 2.11792 ,0.00340081 ,0.0 ,0.1
145162observer2 = - 2.11792 ,0.00340081 ,0.0 ,0.1
146163
147-
148164```
149-
165+ ### Json format file
166+ <!-- python style text highlight -->
167+ ``` json
168+ {
169+ "mesh" : {
170+ "File" : " doc/2d/square2.msh" ,
171+ "BC" : {
172+ "number" : 2 ,
173+ "boundary1" : {
174+ "name" : " Abs" ,
175+ "type" : " Absorbing"
176+ },
177+ "boundary2" : {
178+ "name" : " Ref" ,
179+ "type" : " Reflecting"
180+ }
181+ }
182+ },
183+ "solver" : {
184+ "time" : {
185+ "start" : 0.0 ,
186+ "end" : 0.05 ,
187+ "step" : 5e-05 ,
188+ "rate" : 0.001
189+ },
190+ "elementType" : " Lagrange" ,
191+ "timeIntMethod" : " Runge-Kutta" ,
192+ "numThreads" : 12
193+ },
194+ "initialization" : {
195+ "meanFlow" : {
196+ "vx" : 30.0 ,
197+ "vy" : 0.0 ,
198+ "vz" : 0.0 ,
199+ "rho" : 1.225 ,
200+ "c" : 100.0
201+ },
202+ "number" : 2 ,
203+ "initialCondition1" : {
204+ "type" : " gaussian" ,
205+ "x" : 0.2 ,
206+ "y" : 0.0 ,
207+ "z" : 0.0 ,
208+ "size" : 1.0 ,
209+ "amplitude" : 1.0
210+ },
211+ "initialCondition2" : {
212+ "type" : " gaussian" ,
213+ "x" : -0.2 ,
214+ "y" : 0.0 ,
215+ "z" : 0.0 ,
216+ "size" : 1.0 ,
217+ "amplitude" : 1.0
218+ }
219+ },
220+ "observers" : {
221+ "number" : 2 ,
222+ "observer1" : {
223+ "x" : 2.11792 ,
224+ "y" : 0.00340081 ,
225+ "z" : 0.0 ,
226+ "size" : 0.1
227+ },
228+ "observer2" : {
229+ "x" : -2.11792 ,
230+ "y" : 0.00340081 ,
231+ "z" : 0.0 ,
232+ "size" : 0.1
233+ }
234+ },
235+ "sources" : {
236+ "number" : 3 ,
237+ "source1" : {
238+ "type" : " formula" ,
239+ "fct" : " 0.1 * sin(2 * pi * 50 * t)" ,
240+ "x" : 0.0 ,
241+ "y" : 0.0 ,
242+ "z" : 0.0 ,
243+ "size" : 0.1 ,
244+ "amplitude" : 0.0 ,
245+ "frequency" : 0.0 ,
246+ "phase" : 0.0 ,
247+ "duration" : 0.05
248+ },
249+ "source2" : {
250+ "type" : " file" ,
251+ "fct" : " data/data2.wav" ,
252+ "x" : 0.0 ,
253+ "y" : 0.0 ,
254+ "z" : 0.0 ,
255+ "size" : 0.1 ,
256+ "amplitude" : 0.0 ,
257+ "frequency" : 0.0 ,
258+ "phase" : 0.0 ,
259+ "duration" : 0.05
260+ },
261+ "source3" : {
262+ "type" : " monopole" ,
263+ "fct" : " " ,
264+ "x" : 0.0 ,
265+ "y" : 0.0 ,
266+ "z" : 0.0 ,
267+ "size" : 0.1 ,
268+ "amplitude" : 0.1 ,
269+ "frequency" : 50.0 ,
270+ "phase" : 0.0 ,
271+ "duration" : 0.05
272+ }
273+ }
274+ }
275+ ```
150276## Author
151277* Sofiane Khelladi
152278
0 commit comments