Helmholtz PDE - Cylindrical Coordinates

Hi there! I am brand new and slowly coming up to speed on the use of Fenics. I have read multiple references and went through tutorials but would love some support with creating my first program to make sure I am doing it correctly.

References:
https://fenicsproject.org/pub/femcenter/pub/msc/pdf/phimsc-brandberg-99.pdf

Complex Physical Problem:
Two concentric cylinders of different radii with a membrane at the inlet (larger radii) and a digital microphone at the opposite end. I am trying to determine the appropriate size of the two concentric cylinders to eliminate any chance of resonance below 10kHz.

My thought here was to also leverage this tutorial: Deflection of a membrane — FEniCSx tutorial to add in the deflection of the membrane as a boundary condition.

This is the goal but is a bit more complicated so I thought I’d start with a simpler problem to start.

Simplified Problem:
Two concentric circles of different radii (no membrane) with one end open and the opposite end (digital mic end) closed. The larger side is the open end (no membrane).

Looking through phimsc-brandberg-99.pdf as a good starting reference, the PDE for helmholtz in polar coordinates is:

1/r (rP_r)_r + Pzz + k^2p = 0

with the assumption that the angular coordinate falls out of the equation as the pressure is independent of angle. Which I believe is to be true for me as well.

Boundary Conditions:
Pr = 0 (duct center, r symmetry)
PZ_P = -ikP (Z = rowc, port outlet)
PZ_C = -ikP (Z = row
c, cavity outlet)
Pr-wall = 0 (stiff walls, Z=infinity)
P= Pinlet (source, inlet pressure)

I think this captures the boundary conditions except unsure on the boundary condition of PZ_C where the two cylinders meet if that’s the appropriate assumption there.

And then if all of that is correct, I’d like some help with the variational formulation with this problem.

Any help would be awesome! Thanks!


# Cylinder Acoustics: Helmholtz Equation in a Cylinder

# Constants:
nu = 57.17  # Frequency of the Simulation, Hz
c = 343  # Speed of sound in air, m/s
rho = 1.205  # Density of air, kg/m^3
w = 10  # Velocity normal to boundary, for inflow Neumann condition, m/s (unsure on this)
tol = 1e-10 # Tolerance for boundary condition definitions

# Computing some useful stuff
omega = 2 * np.pi * nu  # Angular frequency, rad/s
k = omega / c  # Wave number, rad/m
s = c / (w * nu)  # Element Size

# Source Amplitude
if np.issubdtype(PETSc.ScalarType, np.complexfloating):  # type: ignore
    A = PETSc.ScalarType(1 + 1j)  # type: ignore
else:
    A = 1

# Define Domain - Cylinder Dimensions with Cylindrical Coordiantes
r_z0 = 1 # radius at z0, m
r_z1 = 1 # radius at z1, m
z1 = 1 # length of cylinder, m 
center_top = Point(0, 0, z1) # defines the center starting point of the circle
center_bot = Point(0, 0, 0)


# Mesh Creation:
mesh_density = 40
cylinder = Cylinder(center_top, center_bot, r_z0, r_z1) # Cylinder('coordinate of center of the top circle', 'coordinate of center of the bottom circle', 'radius of the circle at the top', 'radius of the circle at the bottom')
geometry = cylinder
mesh = create_mesh(geometry, mesh_density) # Making Mesh

PDE Reference:
image