# How to implement a thermal ramp ISO834 in convection-radiation code

**URL:** <https://community.freefem.org/t/how-to-implement-a-thermal-ramp-iso834-in-convection-radiation-code/74>\
**Category:** General Discussion\
**Created:** [June 14, 2019, 5:45pm UTC](https://community.freefem.org/t/how-to-implement-a-thermal-ramp-iso834-in-convection-radiation-code/74 "2019-06-14T17:45:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fffm\_84](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fffm\_84](https://community.freefem.org/u/fffm_84)\
**Post date:** [June 14, 2019, 5:45pm UTC](https://community.freefem.org/t/how-to-implement-a-thermal-ramp-iso834-in-convection-radiation-code/74/1 "2019-06-14T17:45:35Z")

</div>

My problem is to implement a thermal ramp ISO834 in convection-radiation code `(FreeFem++)` for Fourier’s problem.  
I want to obtain a thermal map for a concrete square section, applying the ISO834 ramp to the 4 side boundaries.  
I tried to apply the ISO834 ramp to the time loop, but something goes wrong.

```auto
//Input
// T:1800 (30 minutes analisys), dt:1 time step
real T = 1800, dt = 1;
real u0 = 20, ac = 25, B = 5.670373e-8, e = 0.56, ar = B*e;
//l:thermal conductivity, c:specific heat, r:density
real l = 1.0, c = 1000, r = 2250;

//Mesh (square section 20x20 cm)
real x0 = 0, x1 = 0.20, y0 = 0, y1 = 0.20;
int nx = x1*100, ny = y1*100;
mesh Th = square(nx, ny, [x0+(x1-x0)*x, y0+(y1-y0)*y]);

//Variational form
fespace Vh(Th,P1);
Vh ue, uek;
Vh vold,w,v=u0-ue,b;

problem therm(v,w) = int2d(Th)(r*c*v*w/dt + l*(dx(v) * dx(w) + dy(v) * dy(w)))
+ int1d(Th,1,2,3,4)(b*v*w)
- int2d(Th)(r*c*vold*w/dt);

for(int t=0;t<T;t+=dt){
    vold=v;
    for(int m=0;m<5;m++){
    ue = 20 + 345*log10(8*t/60+1);
    uek = ue + 273.15;
    b = ac + ar * (v + 2*uek) * ((v + uek)^2 + uek^2);
    therm;
}
vold=v+ue;
plot(vold,nbiso=20,fill=1,value=true,boundary=false);

```

---

<div class="post-metadata">

**Author:** ![fotios.kasolis](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fotios.kasolis/32/18_2.png) [@fotios.kasolis](https://community.freefem.org/u/fotios.kasolis)\
**Post date:** [June 14, 2019, 9:25pm UTC](https://community.freefem.org/t/how-to-implement-a-thermal-ramp-iso834-in-convection-radiation-code/74/2 "2019-06-14T21:25:49Z")

</div>

Dear @fffm_84,

As far as I understand the boundary condition is of transient Dirichlet type. It is not clear why you use a finite element function ue with the temporal values throughout the computational domain. If I get you right, you will need a real global variable vbnd, defined before the problem, which will be updated within the time loop vbnd = 20 + 345_log10(8_t/60+1), while you also need to modify your problem with +on(1,2,3,4, v=vbnd). Also keep in mind that you - most probably - want to fix the counter in the for loop to be of type real.

Regards,  
/Fotis

---

<div class="post-metadata">

**Author:** ![fffm\_84](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fffm\_84](https://community.freefem.org/u/fffm_84)\
**Post date:** [June 15, 2019, 12:11pm UTC](https://community.freefem.org/t/how-to-implement-a-thermal-ramp-iso834-in-convection-radiation-code/74/3 "2019-06-15T12:11:34Z")

</div>

Thank you Fotios, for your help.  
I’m trying to deal with a problem of fire resistance; I think the iso834 ramp has to be applied as  
boundary flux condition in the b = ac + ar \* (v + 2\*uek) \* ((v + uek)^2 + uek^2) term  
(not as nodal condition), FEM commercial softwares like Strand7 and similar do this way.  
Probably I need to deeply understand the mathematical problem first.  
Thanks.  
Best regards.
