Hello everyone,
i am student of mechanical engineering and my task is to simulate an ultrasound signal through wood. My goal is to find holes and delaminations.
I have already found some Informations in this forum that maybe i will get a problem with an overestimated transmission. Is it possible that i will have this problems?
Another problem is, that my net calculate stable values if i change the cfl number form 0,2 down to 0,01.
But if i change my net, i am not able to get the same values of pressure, calculated with the same variables beside the net. Obviously that doesnt make sense.
I dont have this problem if i calculate in air. Values in air are independent from cfl and netsize.
I want to fit my result to measurements with the absorption terms. But as long as my values arent independent from net size, that doesnt works.
I hope someone can help me with that.
Best Regards
Dennis Geisler
My code:
% scale geometry
N=320; % Goal
M=320; % Standard
a=N/M;
scale=1;
pml_size= 30*a;
% create the computational grid
Nx = M*a; % number of grid points in the x (row) direction
Ny = M*a; % number of grid points in the y (column) direction
dx = 0.001/a; % grid point spacing in the x direction [m]
dy = 0.001/a; % grid point spacing in the y direction [m]
kgrid = makeGrid(Nx, dx, Ny, dy);
% define the properties of the upper layer of the propagation medium
medium.sound_speed = 343*ones(Nx, Ny); % [m/s]
medium.density = 1*ones(Nx, Ny); % [kg/m^3]
medium.alpha_coeff = 0.1328*ones(Nx, Nx); % [dB/(MHz^y cm)]
% define the properties of the lower layer of the propagation medium
medium.sound_speed(153*a:188*a, :) = 500 ; % [m/s]
medium.density(153*a:188*a, :) = 700; % [kg/m^3]
medium.alpha_coeff (153*a:188*a, :) =1; % [dB/(MHz^y cm)]
medium.alpha_power =1;
medium.alpha_mode ='no_dispersion';
% create the time array
cfl = 0.05; % Courant-Friedrichs-Lewy number
t_end = 0.002;% [s]
% scale time
c=0.1/cfl;
kgrid.t_array = makeTime(kgrid, max(medium.sound_speed(:)), cfl, t_end);
time_schwinger=kgrid.t_array(1,1:2000*a*c);
% define a time varying sinusoidal source
source_freq = 50000; % [Hz]
amplitude = 60; % [Pa]
source_mag = amplitude*[linspace(0,1,round(400*a*c)),ones(1,round(1200*a*c)), linspace(1,0,round(400*a*c))]; % [Pa]
startpoint= [round((10+120+35+90+46/2)*a), round(Ny/2-(16+20)*a)];
angle=0.17;
length=round(40*a);
line = makeLine ( Nx,Ny, startpoint, angle, length);
source.p_mask= line;
quelle=sin(2*pi*source_freq*time_schwinger);
source.p = source_mag.*quelle;
% filter the source to remove high frequencies not supported by the grid
%source.p = filterTimeSeries(kgrid, medium, source.p);
% define a centered circular sensor
sensor.mask = zeros(Nx,Ny);
% sensor oberseite
pos1=round(Ny*10/100);
pos2=round(Ny*20/100);
pos3=round(Ny*30/100);
pos4=round(Ny*40/100);
pos5=round(Ny*50/100);
pos6=round(Ny*60/100);
pos7=round(Ny*70/100);
pos8=round(Ny*80/100);
pos9=round(Ny*90/100);
sensor.mask(60*a, pos1)=1;
sensor.mask(60*a, pos2)=1;
sensor.mask(60*a, pos3)=1;
sensor.mask(60*a, pos4)=1;
sensor.mask(60*a, pos5)=1;
sensor.mask(60*a, pos6)=1;
sensor.mask(60*a, pos7)=1;
sensor.mask(60*a, pos8)=1;
sensor.mask(60*a, pos9)=1;
input_args = {'PMLSize', pml_size, };
% run the simulation
sensor_data= kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});
% define the acoustic parameters to record
sensor.record = {'p', 'p_final', 'I', 'I_avg' };
% =========================================================================
% VISUALISATION
% =========================================================================