Examsimulation1 Solutions
Examsimulation1 Solutions
C
]
T fuel
T coolant
4
CM Exam simulation #1 Solutions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4.4 4.5 4.6 4.7 4.8 4.9 5 5.1 5.2
x 10
-3
0
50
100
150
200
250
300
350
400
450
500
Temporal evolution of temperature profile
Radius [m]
T
e
m
p
e
r
a
t
u
r
e
[
C
]
T cladding
T fuel
T coolant
5
CM Exam simulation #1 Solutions
2) Compute the steady-state temperature distribution in a blanket module for the fusion
machine DEMO, see Fig. 2. In the beryllium region (conductivity k = 149 W/m/K) a
homogeneous heat source of 6 MW/m
3
is present, while in the lithium orthosilicate
region (conductivity k = 15 W/m/K) the heat source is equal to 35 MW/m
3
. As
boundary condition, consider that the horizontal edges of the module are cooled by He
@ T = 100 K with heat transfer coefficient h = 100 W/m
2
/K; the left vertical edge is
kept at constant temperature T = 400 K, while the other is adiabatic.
Prove the grid independence of the results. Plot the temperature profile along the
vertical axis.
Figure 2 Schematic view of a DEMO HCPB blanket module.
a) Save your script in a file to be named ES2_yoursurname.properextension.
b) Save the plot in a file to be named ES2_yoursurname_plot.properextension.
// EXERCISE 2 (Filename: ES2_Rossi.edp)
real k1=149., q1=6.e6;
real k2=15., q2=35.e6;
real The=100., he=100.;
real Tfix=400.;
real l=5.e-2;
real j=5.e-3;
real h=11.e-3;
border a(t=0.,l){x=t;y=0.;};
border b(t=0.,j){x=l;y=t;};
border c(t=0.,l){x=l-t;y=j;};
border d(t=0.,j){x=0.;y=j-t;};
border e(t=0.,h){x=l;y=j+t;};
border f(t=0.,l){x=l-t;y=j+h;};
border g(t=0.,h){x=0.;y=j+h-t;};
plot(a(10)+b(10)+c(10)+d(10)+e(10)+f(10)+g(10));
mesh Th=buildmesh(a(100)+b(10)+c(100)+d(10)+e(20)+f(100)+g(20));
plot(Th);
fespace Vh(Th,P1);
Vh u,v;
6
CM Exam simulation #1 Solutions
int low=Th(l/2.,j/2.).region, up=Th(l/2.,j+h/2.).region;
Vh K=k2*(region==low)+k1*(region==up);
Vh qc=q2*(region==low)+q1*(region==up);
problem prob(u,v)= int2d(Th)(K*(dx(u)*dx(v)+dy(u)*dy(v)))
+int1d(Th,a,f)(he*u*v)
-int1d(Th,a,f)(he*The*v)
-int2d(Th)(qc*v)
+on(d,g,u=Tfix);
prob;
plot(u,fill=1,value=true,ps="ES2_Rossi_plot.eps");
{
ofstream ffa("ES2_Rossi.dat");
ffa<<"% y T"<<endl;
}
real dx=(h+j)/100.;
for(int i=0;i<=100;i++) {
{
ofstream ffa("ES2_Rossi.dat",append);
ffa<<i*dx<<" "<<u(l/2.,i*dx)<<endl;
}
}
%EXERCISE 2 (Filename: "ES2_Rossi.m")
clear all
close all
clc
load ES2_Rossi.dat
figure(1)
set(gca,'fontsize',12)
hold on
grid on
box on
plot(ES2_Rossi(:,1),ES2_Rossi(:,2),'b-','linewidth',2)
xlabel('y (m)')
ylabel('Temperature (K)')
title('Temperature distribution')
print -depsc -f1 ES2_Rossi_plot2
7
CM Exam simulation #1 Solutions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8
CM Exam simulation #1 Solutions
3) Solve the non-linear pendulum with a forcing term:
( )
( )
0
0 0
cos sin
0
2
2
=
=
|
|
.
|
\
|
= +
= t
dt
d
l
g
t
l
g
dt
d
0
0
t 0
0
where l = 0.77 m, g is the gravity acceleration (g = 9.81 m/s
2
). Consider the interval
0<t<10. Plot as two separate subplots in the same figure both the evolution of the angle
with time and the trajectory of the system in the phase space.
a) Save your script in a file to be named ES3_yoursurname.properextension.
b) Save the figure in a file to be named ES3_yoursurname_plot.properextension.
% EXERCISE 3 (Filename: ES3_Rossi.m)
clc
clear all
close all
L=0.77;
g=9.81;
tfin=10;
h=0.1;
t=[0:h:tfin];
y=ones(length(t),1);
teta=ones(length(t),1);
y(1)=0;
teta(1)=0;
f_teta=inline('y');
f_y=inline('-
9.81/0.77*sin(teta)+cos(t*((pi*9.81/0.77)^0.5))','teta','t');
for i=2:length(t)
teta(i)=teta(i-1)+h*(f_teta(y(i-1)));
y(i)=y(i-1)+h*(f_y(teta(i-1),t(i-1)));
end
subplot(1,2,1)
plot(t,teta)
title('Angular velocity')
subplot(1,2,2)
plot(teta,y)
title('Trajectory')
print -depsc -f1 ES3_Rossi_plot
9
CM Exam simulation #1 Solutions