Hi all,
is it possible to record the time varying accoustic intensity with a transducer class and will there be a possibility to do other shapes than a rectangle with the kWaveTransducer? If not what could I change in the program to do so? And I have one more question, would it be possible to add the calculation of the longitudinal and transversal aspects of the wave in the 3D version of kspaceFirstOrder?
Best Regards
k-Wave
A MATLAB toolbox for the time-domain
simulation of acoustic wave fields
Recording Accoustic Intesity
(5 posts) (2 voices)-
Posted 7 years ago #
-
Hi g.schober,
To answer your questions:
(1) It's not currently possible to use the transducer class to record intensity.
(2) Currently, only rectangular elements are supported, and the transducer must be aligned with the grid. In future versions of k-Wave, we intend to allow labelled source matrices to allow multi-element arrays of other types to be defined using the normal pressure and velocity sources.
(3)
kspaceFirstOrder3D
is a fluid model, so doesn't account for transverse waves. If you want to model shear, you should usepstdElastic3D
.Brad.
Posted 7 years ago # -
Hi Brad,
thank you for answering my questions and thank you for offering this toolbox for free. It is usefull for NDT.
Now I have another question, would it be possible to define a disc or any other form on a transducer where the sound can leave and absorb it outside this area? Because when I tried that the simulation got unstable and reached infitiy pretty fast.
Should I 'simply' make my grid thinner (I had 512 grid points on a length of 100mm and my frequenz is 218kHz) or my timesteps shorter to achieve stabability?Best regards
Posted 7 years ago # -
It's certainly possible to define a disk in an absorbing medium, but it's difficult to say more without knowing exactly your parameters. Do you have a working code example that you could post?
Posted 7 years ago # -
Hi Brad,
sorry for my delayed answer it took me some time to get a working Example but now I have one, it still doesn't give the real signal back.
%% define important constants for the simulation SmoothWindow='Gaussian'; Input={'DataCast','gpuArray-single','PlotSim',false,'Smooth',true,'SmoothWindow',SmoothWindow,... 'DataRecast',true}; cc=[343 2330 2600 2600]; cs=[0 1060 1300 1300]; c_max=max([cc,cs]); rho=[1.2 1380 960 960]; Ampli=2; CFL=0.1; hoehe=0.0076/2; %[m] alphac=[0.0136,3,3,3]; alphas=[0,3,3,3]; frequence=218e3; %[Hz] t_end=8e-4; %[s] %% define grid variables and make the grid Nx=2^8; Ny=Nx; Nz=Nx; dx=0.09/Nx; dy=0.09/Ny; dz=0.09/Nz; kgrid=makeGrid(Nx,dx,Ny,dy,Nz,dz); kgrid.t_array=makeTime(kgrid,c_max,CFL,t_end); %% define additional matrizes and values radius=ceil(0.005*sqrt(2)/sqrt((dy)^2+(dz)^2))+1; pathname=['D:\Laurent\Luftultraschall_Simulation\PSTDRichtigeAnregung',num2str(Ampli)]; foldername=[num2str(round(Nx)),'x',num2str(round(Ny)),'x',num2str(round(Nz)),... '_Absorbtion_',num2str(t_end*1e6),'_us_',zeit]; %% define the model and the sensor and source position model=false(Nx,Ny,Nz); model((floor(-hoehe/dx)-1:ceil(hoehe/dx)+1)+round(Nx/2),:,:)=true; sensor.mask=false(Nx,Ny,Nz); sensor.mask(Nx/2+round((0.024+hoehe)/dx),:,:)=makeDisc(Ny,Nz,floor(Ny/2+1),floor(Nz/2+1),radius); source.u_mask=false(Nx,Ny,Nz); source.u_mask(Nx/2-round((0.03+hoehe)/dx),:,:)=makeDisc(Ny,Nz,floor(Ny/2+1),floor(Nz/2+1),radius); Absorbtion=false(Nx,Ny,Nz); Absorbtion(10:(Nx/2-round((0.03+hoehe)/dx)),:,:)= ~source.u_mask(10:(Nx/2-round((0.03+hoehe)/dx)),:,:); Absorbtion((Nx/2+round((0.024+hoehe)/dx)):(end-10),:,:)= ~sensor.mask((Nx/2+round((0.024+hoehe)/dx)):(end-10),:,:); %% create the input signal using toneBurst x=toneBurst(1/kgrid.dt,218e3,0.5,'Envelope','Rectangular'); x=[getWin(length(x),'HalfBand').',zeros(size(x))]; input_signal=repmat(x,1,Ampli); input_signal = applyFilter(input_signal, 1/kgrid.dt, 2*frequence/3.5, 'LowPass'); % disp('Adding noise to the input signal'); % [input_signal,snr]=addNoise(input_signal,35); % disp(['We have a Signal to Noise Ratio of: ',num2str(snr)]); input_signal=[zeros(1,round(1e-6/kgrid.dt)),input_signal]; %% define the medium and the time array medium.sound_speed_compression=cc(1)*ones(Nx,Ny,Nz); medium.sound_speed_compression(model)=cc(2); medium.sound_speed_compression(sensor.mask)=cc(3); medium.sound_speed_compression(source.u_mask)=cc(4); medium.sound_speed_shear=cs(1)*ones(Nx,Ny,Nz); medium.sound_speed_shear(model)=cs(2); medium.sound_speed_shear(sensor.mask)=cs(3); medium.sound_speed_shear(source.u_mask)=cs(4); medium.density=rho(1)*ones(Nx,Ny,Nz); medium.density(model)=rho(2); medium.density(sensor.mask)=rho(3); medium.density(source.u_mask)=rho(4); medium.alpha_coeff_compression=alphac(1)*ones(Nx,Ny,Nz); medium.alpha_coeff_compression(model)=alphac(2); medium.alpha_coeff_compression(sensor.mask)=alphac(3); medium.alpha_coeff_compression(source.u_mask)=alphac(4); medium.alpha_coeff_compression(Absorbtion)=200; medium.alpha_coeff_shear=alphas(1)*ones(Nx,Ny,Nz); medium.alpha_coeff_shear(model)=alphas(2); medium.alpha_coeff_shear(sensor.mask)=alphas(3); medium.alpha_coeff_shear(source.u_mask)=alphas(4); medium.alpha_coeff_shear(Absorbtion)=200; %% define the remaining source values focus_point=[kgrid.x_vec(source.u_mask(:,ceil(Ny/2),ceil(Nz/2)))+0.025,0,0]; source.ux=focus(kgrid,input_signal,source.u_mask,focus_point,cc(1)); % source.u_mode='dirichlet'; %% define the remaining sensor values sensor.record={'p','p_final'}; sensor.frequency_response=[ frequence , 13 ]; % [~,sensor.record_start_index]=findClosest(kgrid.t_array,50e-6); %% Simulation sensor_data=pstdElastic3D(kgrid,medium,source,sensor,Input{:});
I want to simulate a ultrasonic NDT tester with the model is in between the source and the sensor. Also it is a sort of plastic as the medium from the model. The rest is air.
Best RegardsPosted 7 years ago #
Reply
You must log in to post.