Hi everyone, recently I have been trying to simulate point source propagation using straight tubes as a fixed acoustic path.
The inside of the straight pipe is water and the outside is air. The point source propagates from the outside of the straight tube to the inside, and the sensor is at the other end of the straight tube. It is expected that the sensor can receive the signal only when the sound wave propagation time is: t=L_ tube /c_ water, but the actual simulation result is that there is a strange signal at the beginning, and the envelope of this signal is in the form of sine waves. When I increase the initial pressure amplitude, I can see that at the beginning of the simulation, there are strange waves reaching the sensor directly.
I checked the code but can not find the problem. Can anyone helo?
Best Regards
The code is as follows:
If the disc_magnitude is set to 50000, the phenomenon can be clearly seen.
%%%%%straight pipe
d_length=8e-2; % length
d_wide=10e-3; % wide
d_x=2.5e-5; %50um 40um
d_y=2.5e-5; %50um
n_wide=d_wide./d_y;
n_length=d_length./d_x;
r_Nx=n_length+100;
r_Ny=n_wide+100;
mask=zeros(r_Nx,r_Ny);
mask(50:n_length+50,50:n_wide+50)=1;
%%%%%Sensor position
[row_sensor,cow_sensor]=find(mask(50,:)==1);
n_cow_sensor=length(cow_sensor);
sensor_mask=zeros(r_Nx,r_Ny);
sensor_mask(50,50:n_cow_sensor)=1;
%%%%simulation
PML_size =20; % size of the PML in grid points
Nx = r_Nx ; % number of grid points in the x direction
Ny = r_Ny ; % number of grid points in the y direction
dx = d_y; % grid point spacing in the x direction [m]
dy = d_x; % grid point spacing in the y direction [m]
kgrid = kWaveGrid(Nx, dx, Ny, dy);
% define a sensor line
sensor.mask = sensor_mask;
% define the properties of the propagation medium
result = logical(mask);
medium.sound_speed = 343 * ones(Nx, Ny); % [m/s] 空气中声速 343
medium.sound_speed(result) = 1500; % [m/s] 水中声速
medium.density = 1.225 * ones(Nx, Ny); % [kg/m^3] 空气密度 1.225
medium.density(result) = 1000; % [kg/m^3] 水密度
% set the simulation time to capture the reflections
t_end =6.5e-5;
% 2.5 * kgrid.x_size / max(medium.sound_speed(:));
% define the time array
cfl=0.25;
kgrid.makeTime(medium.sound_speed, cfl,t_end);
% create initial pressure distribution using makeDisc
n_row_source=3255;
n_cow_source=310;
disc_magnitude =50000; % [Pa]
disc_y_pos = n_cow_source; % [grid points]
disc_x_pos =n_row_source; % [grid points]
disc_radius=2;
disc_1 = disc_magnitude * makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius);
% smooth the initial pressure distribution and restore the magnitude
p0 = smooth(disc_1, true);
% assign to the source structure
source.p0 = p0;
input_args = {'PMLSize', PML_size};
% run the simulation
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor,input_args{:});
sensor_t=sum(sensor_data);
plot(sensor_data);
%%
% =========================================================================
% VISUALISATION
% =========================================================================
% plot the initial pressure and sensor distribution
figure;
imagesc(kgrid.y_vec * 1e3, kgrid.x_vec * 1e3, p0 + sensor.mask * disc_magnitude, [-disc_magnitude, disc_magnitude]);
colormap(getColorMap);
ylabel('x-position [mm]');
xlabel('y-position [mm]');
axis image;
colorbar;
scaleFig(1, 0.65);
%% %% 单探测器
sensordata=mean(sensor_data); %之前用的是mean
plot(kgrid.dt:kgrid.dt:kgrid.dt*kgrid.Nt,sensordata);
xlabel('t/s');
ylabel('PA');
title(disc_y_pos);
%%
plot(kgrid.dt:kgrid.dt:kgrid.dt*kgrid.Nt,sensor_data(25,:));
xlabel('t/s');
ylabel('PA');
title('原信号');