Mixed-formulation for time-domain wave equation

Hello!

I apologize for the long question, but I’m a bit lost so I’ll try to be as precise as I can.

I am following the implementation of a time-domain PML formulation for wave propagation, which can be found in this work. The author has developed a set of equations for the wave propagation in fluid (\Omega_F) and solid (\Omega_S) medium. It reads, for \Omega_F


(eq. 5.9)

where a_j, b and c are functions either of \alpha or \beta (from the PML formulation). The equations are valid throughout the fluid domain \Omega_F, and within the physical domain a_j, b and c equal 0 so we have the classical wave equation, as shown in the figure.

\partial^2 p / \partial t ^2 = v^2 \nabla ^2p
\partial v_j / \partial t = - (1/ \rho) \partial p/ \partial x_j

The author has also given the weak form as follows


(eq. 5.10a)
image
(eq. 5.10c)

where the second term of the first equation (the integral over \Gamma) concerns the fluid-solid interface (nonexistent in this scenario).\phi and \psi_j are test functions.

Now I wish to translate this to FEniCS. For sake of simplicity, I’m concerned only with \Omega_F and will use a point source in its physical domain. So I believe the second term of eq. 5.10a vanishes and F = 0. \alpha and \beta will be set depending if we’re in the PML or in the physical domain.

I have read the Mixed formulation for Poisson equation example, and, according to what I understood, I’ll have to put eqs. 5.10a and 5.10c together. But I’m confused about how to deal with the j components and with \partial \phi / \partial x_j.

It would be very helpful if somebody could give me some advice on how to approach this problem. Thanks in advance!

Well concerning the indexing and components: The easiest way to “avoid” these is to interpret the differential operators not coordinate wise, but in a coordinate free way. For example, the first term of 5.10a can be rewritten (in ufl notation) as

1/rho*inner(grad(p), grad(phi))*dx - inner(av, grad(phi))*dx

assuming that you can define a_j v_j directly (and I am not sure what rho_{F_j}} is, so I took it as a scalar.

If that is not the case, and you need to access the components, here is what you can do:

v[j]

gives you the j-th component of the vector valued function j, and

p.dx(i)

gives dp/dx_i .
For a more detailed description see chapter 17.4.4 of the fenics book: https://fenicsproject.org/book/ (you can access a free version here: https://launchpadlibrarian.net/83776282/fenics-book-2011-10-27-final.pdf )
Which can also allow you to use the Einstein summation convention etc.

Thanks for your reply @plugged. I see what you mean, but before I try it I have a very simple question.
I believe this is a linear system, so I should be able to use the command

A, b = assemble_system(a, L, bc)
solve(A,u.vector,b)

but then I’m not sure how to rewrite the Weak Form provided by the author into the one that meets FEniCS syntax.

Am I allowed to use some of the below instead?

solve(a==L,u,bcs=bc)

or

solve(F==0,u,bcs=bc)
1 Like

I managed to rewrite eq. 5.10a and 5.10c as

but now I don’t know how to choose a and L for the weak form.

Any thoughts?

Concerning the first question: Is F is really linear (in the variable), then

solve(a==L, u, bcs=bc)

and

solve(F==0, u, bcs=bc)

are equivalent if a and L are the corresponding bilinear and linear parts. The nonlinear solver, which defaults to a newton method, computes the corresponding Jacobian of F, and it is easy to see that the first Newton iteration is just the linear solve for the system, as the Jacobian of a linear operator is the operator itself.

If you know that F is linear in your desired variable, then you can use the command

a, L = system(F)

or, equivalently

a = lhs(F)
L = rhs(F)

which give you the corresponding linear forms, but iirc you need to define F with the help of Trial and Testfunctions, and not Functions and Testfunctions as you would need for a nonlinear problem.
Other than that it is just as simple as collecting all parts that are linear in your variable into one form and all the others (where your Trialfunction is not present) into the other form and giving the second one a minus sign.

Ok! My idea is to combine these two equations

into one and use

solve(F==0, u ,bcs=bc)

and see what it gives, since I’m not sure how to write the bilinear-linear form. Thank you for the explanation about the Trial and TestFunctions!

Hi,
Did you manage to find a working solution? I’m currently struggling on a very similar problem.

Hi,
Actually I’ve changed my formualtion to the frequency domain in order to avoid this mixed description, but then I could not proceed with the PMLs, unfortunately.

1 Like