Delete Project/Init_Solution_mult.m

This commit is contained in:
Lisa Pizzo 2026-01-26 20:38:25 +01:00
commit e8ae0af46e

View file

@ -1,42 +0,0 @@
function u0 = Init_Solution_mult(model, u_wall, u_fluid, u_air)
mesh = model.Mesh;
nodes = mesh.Nodes;
elements = mesh.Elements;
Nnodes = size(nodes,2);
Nelems = size(elements,2);
u0 = zeros(Nnodes,1); %initialize solution vector
regions = zeros(Nelems,1);
regions(findElements(mesh,'region','Face',1)) = 1; % wall
regions(findElements(mesh,'region','Face',2)) = 2; % fluid
regions(findElements(mesh,'region','Face',3)) = 3; % air
% Creates a boolean array to ensure each node is assigned a temperture only
% once
nodeAssigned = false(Nnodes,1);
for e = 1:Nelems
vert = elements(:,e); %current element
switch regions(e) %determines which temperature to assign
case 1
u_val = u_wall;
case 2
u_val = u_fluid;
case 3
u_val = u_air;
end
%loops over the three nodes of the current element
% if a node has not been assinged -> u_val andmarks assigned in the
% boolean vector
for k = 1:3
i = vert(k);
if ~nodeAssigned(i)
u0(i) = u_val;
nodeAssigned(i) = true;
end
end
end
end