<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: About laser ultrasound simulation</title>
		<link>http://www.k-wave.org/forum/topic/about-laser-ultrasound-simulation</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 06:52:38 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/about-laser-ultrasound-simulation" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "About laser ultrasound simulation"</title>
			<link>http://www.k-wave.org/forum/topic/about-laser-ultrasound-simulation#post-7740</link>
			<pubDate>Wed, 19 Aug 2020 14:30:55 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7740@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Alex,&#60;/p&#62;
&#60;p&#62;In this equation, I think the heat source term is in units of J.m^-3.s^-1. &#60;/p&#62;
&#60;p&#62;If you are adding the source to a fluid region of the domain, then you can just assign the same source term (in units of pascals) to the normal components of the stress. You will need to add a minus sign if you want the same polarity.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>alexmm on "About laser ultrasound simulation"</title>
			<link>http://www.k-wave.org/forum/topic/about-laser-ultrasound-simulation#post-7694</link>
			<pubDate>Wed, 08 Jul 2020 22:33:46 +0000</pubDate>
			<dc:creator>alexmm</dc:creator>
			<guid isPermaLink="false">7694@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;If I have a temperature field over time, would it be possible to add that as a stress source?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>alexmm on "About laser ultrasound simulation"</title>
			<link>http://www.k-wave.org/forum/topic/about-laser-ultrasound-simulation#post-7693</link>
			<pubDate>Wed, 08 Jul 2020 20:55:05 +0000</pubDate>
			<dc:creator>alexmm</dc:creator>
			<guid isPermaLink="false">7693@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;Thank you for your answer. I am now trying to use the same model and include a 2d model for the laser source.&#60;/p&#62;
&#60;p&#62;I have an equation that can deposit a given power per unit volume at a given location and depth and time. &#60;/p&#62;
&#60;p&#62;In the k-wave manual pg 8 it says I can add a mass source using S_M = S_H*beta*C_p. For that equation, what are the units of S_H? Are they J/m^3? What if I have a changing power over time?&#60;/p&#62;
&#60;p&#62;For the pstdElastic2D solver I can only add stress sources that change over time. Is there a mesh dependent conversion factor I need to use to change S_M to a stress source?&#60;br /&#62;
I'm guessing this same value has to be added to xx and yy components is this correct?&#60;/p&#62;
&#60;p&#62;Thank you,&#60;br /&#62;
Alex
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "About laser ultrasound simulation"</title>
			<link>http://www.k-wave.org/forum/topic/about-laser-ultrasound-simulation#post-7653</link>
			<pubDate>Sat, 27 Jun 2020 13:20:00 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7653@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Alex,&#60;/p&#62;
&#60;p&#62;Regarding simulating air boundaries, spectral methods sometimes struggle as discussed in the &#60;a href=&#34;http://www.k-wave.org/forum/topic/simulation-of-ultrasonic-testing-borehole-in-solid&#34;&#62;this post&#60;/a&#62;. &#60;/p&#62;
&#60;p&#62;By default, the outer boundaries are always absorbing (a perfectly matched layer is used). In principle, it's straightforward to impose Dirichlet and Neumann boundary conditions on the grid boundary (as discussed in &#60;a href=&#34;https://arxiv.org/pdf/2005.00322&#34;&#62;this paper&#60;/a&#62; with code examples &#60;a href=&#34;https://www.mathworks.com/matlabcentral/fileexchange/75071-matlab-discrete-trigonometric-transform-library&#34;&#62;here&#60;/a&#62;). However, this doesn't currently form part of k-Wave.&#60;/p&#62;
&#60;p&#62;You will need the parallel computing toolbox and a compatible GPU to use the &#60;code&#62;&#38;#39;DataCast&#38;#39;&#60;/code&#62; GPU options. What is the error you receive? Can you run native MATLAB code on the GPU (try casting something to &#60;code&#62;gpuArray&#60;/code&#62;).&#60;/p&#62;
&#60;p&#62;I don't know a reference off-hand for this unfortunately, but it's likely some one has tried it before.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>alexmm on "About laser ultrasound simulation"</title>
			<link>http://www.k-wave.org/forum/topic/about-laser-ultrasound-simulation#post-7631</link>
			<pubDate>Fri, 19 Jun 2020 12:36:53 +0000</pubDate>
			<dc:creator>alexmm</dc:creator>
			<guid isPermaLink="false">7631@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;     I’d like to say I’ve found the k-wave software really useful. Because of COVID I couldn’t access lab equipment to run an experiment and I’m using k-wave to simulate it.&#60;/p&#62;
&#60;p&#62;It’s really good work. What I’m using now is the elastic solver in 2d to simulate surface motion from a laser ultrasound setup for NDT.&#60;/p&#62;
&#60;p&#62;The code is the following:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;close all
clear all

%Physical parameters (all in SI units)

%Air properties
factor = 2.0;

rho_air     = 1.225/factor^2;
c_long_air  = 343.0*factor;
c_shear_air = 0.0;

%Aluminum properties (pg 273 Scruby book)
rho_Al     = 2700.0;
c_long_Al  = 6400.0;
c_shear_Al = 3150.0;

%Laser properties
t_pulse_width = 10.0e-9; %(10 ns)
f_max         = 0.1874/t_pulse_width

%Simulation domain
x_Al          = 2.00e-3;
x_air         = 0.56e-3;
y_size_length = 7.68e-3; %Factor of 3 instead of 2

%Generation laser pulse width
%Compute dx and Nx based on a desired x_size and f_max
points_per_wavelength = 3; %Can use min of 3, better to use higher number
max_possible_dx = min([c_long_air c_long_Al c_shear_Al])/f_max/points_per_wavelength
dx = 5.0e-6*factor

%Try to make these numbers a power of 2 (pg 30 of k-Wave manual)
Nx_Al  = round(x_Al/dx)
Nx_air = round(x_air/dx)
Nx     = Nx_Al+Nx_air
Ny     = round(y_size_length/dx)

%Create computational grid
kgrid = kWaveGrid(Nx,dx, Ny,dx);

%Define the compressional sound speed [m/s]
medium.sound_speed_compression                  = c_long_Al*ones(Nx, Ny);
medium.sound_speed_compression((Nx_Al+1):end,:) = c_long_air;

%Define the shear sound speed [m/s]
medium.sound_speed_shear                  = c_shear_Al*ones(Nx, Ny);
medium.sound_speed_shear((Nx_Al+1):end,:) = c_shear_air;

%Define the mass density [kg/mˆ3]
medium.density                  = rho_Al*ones(Nx, Ny);
medium.density((Nx_Al+1):end,:) = rho_air;

%Define the absorption coefficients [dB/(MHzˆ2 cm)]
medium.alpha_coeff_compression = 0.0;
medium.alpha_coeff_shear       = 0.0;

%Define circular through hole (along width)
depth      = 1.0e-3;
diam       = 0.5e-3;

y_position = round(0.5e-3/dx);
x_position = round((x_Al-depth)/dx);
radius     = round(diam/2.0/dx);
plot_disc  = 0;
disc       = makeDisc(Nx,Ny, x_position,y_position, radius, plot_disc);

medium.sound_speed_compression(disc == 1) = c_long_air;
medium.sound_speed_shear(disc == 1)       = c_shear_air;
medium.density(disc == 1)                 = rho_air;

figure; surf(medium.density)

%Create the time array
cfl   = 0.008;  %(0.02 with air props) % Courant-Friedrichs-Lewy number
t_end = 1.2e-6; % [s]
kgrid.makeTime(max(medium.sound_speed_compression(:)), cfl, t_end);

%Define an initial pressure distribution using makeBall
height_from_bottom = 1.9e-3;
from_side          = 5.0e-3;
source.p0 = 2.0*makeDisc(Nx,Ny,round(height_from_bottom/dx),round(from_side/dx), 5); %Radius should be 10

%Define a 3D binary sensor mask for a single grid point
from_side = 2.0e-3;

sensor.mask                            = zeros(Nx,Ny);
sensor.mask(Nx_Al,round(from_side/dx)) = 1;
sensor.record                          = {&#38;#39;p&#38;#39;,&#38;#39;u&#38;#39;};

%Plot sound source and sensor locations
figure; surf(logical(source.p0)+sensor.mask)

%Run the simulation
input_args = {&#38;#39;PlotScale&#38;#39;,[-0.75, 0.75, -0.15, 0.15], &#38;#39;PlotPML&#38;#39;,false, &#38;#39;DisplayMask&#38;#39;,zeros(Nx,Ny), &#38;#39;DataCast&#38;#39;,&#38;#39;single&#38;#39;, ...
              &#38;#39;RecordMovie&#38;#39;,true, &#38;#39;MovieName&#38;#39;,&#38;#39;example_movie&#38;#39;, &#38;#39;PlotScale&#38;#39;,[-0.1, 0.1], &#38;#39;PlotFreq&#38;#39;,50, &#38;#39;MovieProfile&#38;#39;,&#38;#39;MPEG-4&#38;#39;};

sensor_data = pstdElastic2D(kgrid, medium, source,sensor, input_args{:});

%Plot A-scan data
figure; plot(kgrid.t_array, sensor_data.ux)&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I have a few questions regarding a more accurate simulation and computation speed.&#60;/p&#62;
&#60;p&#62;• Right now I’m simulating an Aluminum sample with a through hole and a free surface (with air properties).&#60;br /&#62;
Instead of having an air layer, how could I enforce a free layer (reflecting?) boundary condition instead of a sample air interface. Are the BCs absorbing by default?&#60;/p&#62;
&#60;p&#62;• I tried using the gpu option but it’s not working at the moment. Do I have to install something else to make this work?&#60;/p&#62;
&#60;p&#62;• Is there an example (papers and/or code) of using a point, line (or half circle?) with a certain directivity function and time profile to more accurately simulate a laser pulse?&#60;/p&#62;
&#60;p&#62;Thank you,&#60;br /&#62;
Alex
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
