# Thermoelasticity and Free FEM

**URL:** https://community.freefem.org/t/thermoelasticity-and-free-fem/1452
**Category:** General Discussion
**Created:** [January 24, 2022, 5:46pm UTC](https://community.freefem.org/t/thermoelasticity-and-free-fem/1452 "2022-01-24T17:46:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![amir](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@amir](https://community.freefem.org/u/amir)
#### Post date: [January 24, 2022, 5:46pm UTC](https://community.freefem.org/t/thermoelasticity-and-free-fem/1452/1 "2022-01-24T17:46:04Z")

</div>

Dear friends,  
I have a problem in coding to solve a system of thermoelastic equations.

 ![bandicam 2022-01-24 21-07-27-540](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/c4ecb5d5b82abc7c5f89794e2d9bdfc422cc1285.jpeg)

I have written for first equation in my code as follows.

problem thel1([u,v,T],[uh,vh,Tbar])= int2d(TD)(lambda\*div(u,v)\*div(uh,vh)+2._mu_(epsilon(u,v)'_epsilon(uh,vh))  
-kappa_(T-Told)_div(uh,vh))- int2d(TD)(f_vh) + on(4,u=0,v=0);

However, after running, it shows me the following error!

36 : -kappa\*(T-Told) error operator - \<10LinearCombI7MGauche4C\_F0E\>, \<St4pairIP6FEbaseId5v\_fesEiE\>

Could you please help me??

---

<div class="post-metadata">

### Author: ![zhaog6](https://avatars.discourse-cdn.com/v4/letter/z/4af34b/32.png) [@zhaog6](https://community.freefem.org/u/zhaog6)
#### Post date: [January 25, 2022, 4:32am UTC](https://community.freefem.org/t/thermoelasticity-and-free-fem/1452/2 "2022-01-25T04:32:33Z")

</div>

Note: the `-kappa * Told * div(uh, vh)` is a right-hand side. the weak form can be written as follows

```auto
problem thel1([u,v,T],[uh,vh,Tbar])= int2d(TD)(lambda*div(u,v)*div(uh,vh)
                    + 2.*mu*(epsilon(u,v)'*epsilon(uh,vh)) - kappa*T*div(uh,vh))
                    - int2d(TD)(f*vh - kappa*Told*div(uh, vh))
                    + on(4,u=0,v=0);
```

---

<div class="post-metadata">

### Author: ![amir](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@amir](https://community.freefem.org/u/amir)
#### Post date: [January 25, 2022, 4:03pm UTC](https://community.freefem.org/t/thermoelasticity-and-free-fem/1452/3 "2022-01-25T16:03:10Z")

</div>

Thank you very much.  
Would you please help me about the second equation??  
I’ve written it as follows.

problem thel2([u,v,T],[uh,vh,Tbar])= int2d(TD)(rho_c_idt_T_Tbar)  
+int2d(TD)(kappa_T0_idt_div(u,v))  
+int2d(TD)(k_grad(T)'_grad(Tbar))  
-int2d(TD)(rho_c_idt_Told_Tbar+kappa_T0_idt_div(uold,vold)\*Tbar)  
+on(1,T=100);

I’m learning Free FEM, then I’m not ok how to code.
