<?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: Can k-wave do simulations in porous media?</title>
		<link>http://www.k-wave.org/forum/topic/can-k-wave-do-simulations-in-porous-media</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 22:34:52 +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/can-k-wave-do-simulations-in-porous-media" rel="self" type="application/rss+xml" />

		<item>
			<title>bencox on "Can k-wave do simulations in porous media?"</title>
			<link>http://www.k-wave.org/forum/topic/can-k-wave-do-simulations-in-porous-media#post-8510</link>
			<pubDate>Mon, 25 Apr 2022 19:21:36 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">8510@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi sgrgimire, &#60;/p&#62;
&#60;p&#62;What's wrong with the way you're doing it? Note that the air-filled case may be difficult because k-Wave converges quite slowly when there are large impedance differences. In other words, you would need to have many grid points per wavelength to get accurate reflections from the pores.&#60;/p&#62;
&#60;p&#62;Best wishes&#60;br /&#62;
Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sgrghimire on "Can k-wave do simulations in porous media?"</title>
			<link>http://www.k-wave.org/forum/topic/can-k-wave-do-simulations-in-porous-media#post-8482</link>
			<pubDate>Thu, 17 Mar 2022 17:12:33 +0000</pubDate>
			<dc:creator>sgrghimire</dc:creator>
			<guid isPermaLink="false">8482@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;The code included here doesn't have BonA but I have included the non linear parameter when doing the simulations.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sgrghimire on "Can k-wave do simulations in porous media?"</title>
			<link>http://www.k-wave.org/forum/topic/can-k-wave-do-simulations-in-porous-media#post-8481</link>
			<pubDate>Thu, 17 Mar 2022 16:25:58 +0000</pubDate>
			<dc:creator>sgrghimire</dc:creator>
			<guid isPermaLink="false">8481@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I have a simulation that imports SEM (&#60;a href=&#34;https://imgur.com/8mFivA5&#34; rel=&#34;nofollow&#34;&#62;https://imgur.com/8mFivA5&#60;/a&#62;) images of aerogels with different pore sizes, the pores may be filled with fluid or air. I want to define the region inside the pores with different values of density and sound speed. Is there a efficient way to do this?&#60;/p&#62;
&#60;p&#62;Here is my code so far!&#60;/p&#62;
&#60;p&#62;clearvars;&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
Nx = 200 ; % number of grid points in the x (row) direction&#60;br /&#62;
Ny = 200; % number of grid points in the y (column) direction&#60;br /&#62;
dx = 5e-6; % grid point spacing in the x direction [m]&#60;br /&#62;
dy = 5e-6; % grid point spacing in the y direction [m]&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;%load image&#60;br /&#62;
img1 = loadImage('x-ca-1.bmp');&#60;/p&#62;
&#60;p&#62;%resize&#60;br /&#62;
img1 = resize(img1, [Nx,Ny]);&#60;br /&#62;
img_indices1 = find(img1 ==1);&#60;/p&#62;
&#60;p&#62;% define the medium properties&#60;/p&#62;
&#60;p&#62;%Medium%&#60;br /&#62;
medium.sound_speed = 1500*ones(Nx, Ny); % [m/s]&#60;br /&#62;
medium.density = 1000 * ones(Nx, Ny);&#60;/p&#62;
&#60;p&#62;%aerogel&#60;br /&#62;
medium.sound_speed(img_indices1) = 300;&#60;br /&#62;
medium.density(img_indices1) = 500;&#60;/p&#62;
&#60;p&#62;%Define source&#60;br /&#62;
mag = 10;&#60;br /&#62;
source.p0 = mag * makeLine(Nx, Ny,[10,99],[10,101]); &#60;/p&#62;
&#60;p&#62;% define a 2D binary sensor mask in the shape of a line&#60;br /&#62;
x_offset1 = 25; % [grid points]&#60;br /&#62;
x_offset2 = 175;&#60;br /&#62;
width = 1; % [grid points]&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
sensor.mask(x_offset1, Ny/2 - width/2 + 1:Ny/2 + width/2) = 1;&#60;br /&#62;
sensor.mask(x_offset2, Ny/2 - width/2 + 1:Ny/2 + width/2) = 1;&#60;/p&#62;
&#60;p&#62;% define the frequency response of the sensor elements&#60;br /&#62;
center_freq = 40e6;      % [Hz]&#60;br /&#62;
bandwidth = 80;         % [%]&#60;br /&#62;
sensor.frequency_response = [center_freq, bandwidth];&#60;/p&#62;
&#60;p&#62;% set the input options&#60;br /&#62;
input_args = {'DataCast', 'gpuArray-single'};&#60;/p&#62;
&#60;p&#62;%run simulations&#60;br /&#62;
[sensor_data] = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;% compute the amplitude spectra of the recorded time series&#60;br /&#62;
[f, sensor_data1] = spect(sensor_data(1,:), 1/kgrid.dt);&#60;br /&#62;
[f, sensor_data2] = spect(sensor_data(2,:), 1/kgrid.dt);&#60;/p&#62;
&#60;p&#62;% plot the amplitude spectra&#60;br /&#62;
[f_sc, scale, prefix] = scaleSI(max(f));&#60;br /&#62;
plot(f * scale, sensor_data1, 'k-',...&#60;br /&#62;
    f * scale, sensor_data2, 'r-');&#60;br /&#62;
xlabel(['Frequency [' prefix 'Hz]']);&#60;br /&#62;
ylabel('Amplitude [au]');&#60;br /&#62;
legend('sensor-1', 'sensor-2');
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
