# [Getdp] Problems solving an inhomogeneous 2d wave equation

Timm F. Gloger gloger at physik.uni-siegen.de
Wed Mar 17 13:19:40 CET 2010

```Hi,

I am trying to solve a scalar, inhomogenous wave equation in 2d in the
time domain.

Basically I am trying to simulate the time evolution of point-like
excitation of medium surrounded by a perfectly reflecting "surface".

My reflecting boundary is an ellipse and the source of the excitation is
put into one of it's focal spots.
What I would expect to see is that the point-source creates a sharp
needle-like excitation that propagates as a cylindrical wave away from
one focal spot and is then perfectly imaged at the second focus,
reproducing again the needle-like peak.

In terms of the getdp formulation of the problem I started with the
geometrical definitions. I have 3 physical regions:

boundary - the reflecting boundary (Physical Line)
source - the point where the excitation is created (Physical Point)
inside - everything surrounded by the boundary (Physical Surface)

total - all three regions

The perfectly reflecting boundary is expressed via a Dirichlet
constraint that requires a vanishing field at the boundary:

Constraint {
{ Name reflectingBoundary;
Type Assign;
Case {
{ Region boundary ; Value 0.0 ; }
}
}
}

The excitation is created by a sinusoidal force with the frequency
"Freq" that is switched on at the time t=0 and switched of after one period:

Delta[ source ] = (\$Time<1/Freq) ? Sin[2.0*Pi*Freq*\$Time] : 0;

I am then trying to solve the wave equation on a function space of Form0
type:

Equation { // wave equation:  Dt(Dt(e)) + 1/c^2 grad(div(e)) == -Delta
Galerkin { DtDt [ Dof{e} , {e} ];
In inside; Integration I1; Jacobian JVol;  }

Galerkin { [ c^2 * Dof{Grad e} , {Grad e} ];
In inside; Integration I1; Jacobian JVol;  }

Galerkin { [ Delta[], {e} ];
In source; Integration I1; Jacobian JVol; }
}

with a time loop of the Newmark scheme:

Operation {
InitSolution[A];
InitSolution[A];
//Newmark scheme with beta=0.25 gamma=0.5
TimeLoopNewmark[t_min,t_max,dt,0.25,0.5] {
Generate[A];
Solve[A] ;
SaveSolution[A];
}
}

The physical quantities I calculate from the results are the field
amplitude and the overall energy of the system:

Quantity {
//time evolution of the field
{ Name e_t ; Value{ Local{ [ {e} ]; In total; Jacobian JVol; } } }
//time evolution of the "energy" of the whole system
{ Name energy_t; Value{ Integral{ [{e} * {e}]; In total;
Integration I1; Jacobian JVol;}}}
}

When I run the simulation I see a nice needle-like excitation that
propagates away from the source point, is reflected at the boundary and
than somewhat focused into the second focal spot.
But the image of the source is far from being "perfect" or anything
needle-like.
Also the energy of the system is not constant after the source has been
switched off.

The same problems occure if i change the boundary from an ellipse to a
circle with the source at the center.

My question is, if there is something wrong with my getdp or mesh files
(which I have attached), if I have touched a limitation of getdp, if I
just missed something important or what could be an explanation of this
unexpected results.

(I run the simulation via "getdp EllipticalMirror.pro -pre
scalarWaveEquation_t -cal -pos scalarField_t" using getdp 2.0.0 and gmsh
2.4.2 on OSX 10.6.2)

Kind regards
Timm Gloger
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: EllipticalMirror.geo
URL: <http://www.geuz.org/pipermail/getdp/attachments/20100317/20a65aaf/attachment.geo>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: EllipticalMirror.pro
URL: <http://www.geuz.org/pipermail/getdp/attachments/20100317/20a65aaf/attachment.pro>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: IntJac.pro
URL: <http://www.geuz.org/pipermail/getdp/attachments/20100317/20a65aaf/attachment-0001.pro>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: SharedNames.geo
URL: <http://www.geuz.org/pipermail/getdp/attachments/20100317/20a65aaf/attachment-0001.geo>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: solver.par
URL: <http://www.geuz.org/pipermail/getdp/attachments/20100317/20a65aaf/attachment.par>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: WaveEquation.pro
URL: <http://www.geuz.org/pipermail/getdp/attachments/20100317/20a65aaf/attachment-0002.pro>
```