Plot for concentration profile?
4 views (last 30 days)
Show older comments
I have tried making code for RED, but am not sure about concentration profile and boundary conditions
%%
clc;
clear;
close all;
% Given Inputs (Boundary Conditions)
Nm = 50; % Number of membranes
Ns = 5; % Number of stacks
Np = 20; % Number of branches
Am = 0.06; % Membrane Area (m^2)
T = 298.15; % Temperature (K)
Vh = 11.989; % Volume of high salinity stream (m^3)
Vl = 13.838; % Volume of low salinity stream (m^3)
Ch0 = 61.35; % Concentration of high salinity stream (mol/m^3)
Cl0 = 1.083; % Concentration of low salinity stream (mol/m^3)
fRED = 0.5; % Operability factor
Ra = 0.0011; % Resistance anion membrane (ohm·m²)
Rc = 0.0011; % Resistance cation membrane (ohm·m²)
Ll = 0.01; % Thickness low salinity channel (m)
Lh = 0.02; % Thickness high salinity channel (m)
a = 0.98; % Selectivity
Sh = 0.0147; % Conductivity high salinity (S/m)
Sl = 0.016; % Conductivity low salinity (S/m)
% Constants
F = 96485; % Faraday's constant (C/mol)
Rg = 8.314; % Universal gas constant (J/mol·K)
% Calculations
B = Vl / Vh;
Ch = Ch0 - (B / (1 + B)) * fRED * (Ch0 - Cl0);
Cl = Cl0 + (1 / (1 + B)) * fRED * (Ch0 - Cl0);
Ve = 2 * Nm * Ns * (a * Rg * T / F) * log10(Ch / Cl);
q = a * (Vh / (Nm * Ns)) * F * (B / 1 + B) * fRED * (Ch0 - Cl0);
Rs = (Nm * Ns) / (Am * Np) * (Ra + Rc + (Ll / (Sl * Cl)) + (Lh / (Sh * Ch)));
ERED = (Rs / (Rs + 0.1 * Rs)) * Ve * q;
ERED_prime = ERED * 0.0000001 * 0.278;
% Display the Results
fprintf('Results:\n');
fprintf('Final High Salinity Concentration (Ch): %.4f mol/m^3\n', Ch);
fprintf('Final Low Salinity Concentration (Cl): %.4f mol/m^3\n', Cl);
fprintf('Electromotive Force (Ve): %.4f V\n', Ve);
fprintf('Charge Transported (q): %.4f C\n', q);
fprintf('System Resistance (Rs): %.4f Ohm\n', Rs);
fprintf('Power Output (ERED): %.4f W\n', ERED);
fprintf('Power Output (ERED): %.4f W\n', ERED');
% Performance Evaluation: ERED vs Membrane Area
Am_values = linspace(0.5*Am, 1.5*Am, 50);
ERED_values = zeros(size(Am_values));
for i = 1:length(Am_values)
Am_var = Am_values(i);
Rs_var = (Nm * Ns) / (Am_var * Np) * (Ra + Rc + (Ll / (Sl * Cl)) + (Lh / (Sh * Ch)));
ERED_var = (Rs_var / (Rs_var + 0.1 * Rs_var)) * Ve * q;
ERED_values(i) = ERED_var;
end
% Plotting
figure;
plot(Am_values, ERED_values, '-o', 'Color', 'b', 'MarkerSize', 5, 'MarkerFaceColor', 'b');
grid on;
xlabel('Membrane Area (m^2)');
ylabel('Power Output ERED (W)');
title('Performance Evaluation: ERED vs Membrane Area');
1 Comment
Torsten
on 29 Apr 2025
There is no variation in the variable "ERED_var":
ERED_var = (Rs_var / (Rs_var + 0.1 * Rs_var)) * Ve * q = 1/1.1 * Ve * q,
and this value does not depend on Am.
Answers (0)
See Also
Categories
Find more on Oceanography and Hydrology in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!