Azzera filtri
Azzera filtri

is it possible to solve 2 PDEs simultaneously using finite difference method in matlab

2 visualizzazioni (ultimi 30 giorni)
I want to model a thermal energy storage system where the temperatures of the HTF and the PCM are given as:
dTf/dt = Af*d^2Tf/dx^2 - Bf*dTf/dx - Cf(Tf - Tpcm) and
dTs/dt = Apcm*d^2Ts/dx^2 - Cpcm(Tpcm - Tf)
where Af, Apcm, Bf, Cf and Cpcm are constants.
Initial conditions are:
Tf(x,0) = 180 degC and Tpcm(x,0) = 25 degC
Boundary conditions:
At x=o: dTf/dx = 0 and Tpcm = 180 degC
At x=0.3: dTpcm/dx = 0 and Tf = 150 degC
I have used the pdepe, but I not happy with the temperature distributions i am getting, maybe I need to adjust my initial and boundary conditions. That's why I am trying to solve the 2 PDEs using finite difference method
  8 Commenti
Torsten
Torsten il 2 Feb 2024
Modificato: Torsten il 2 Feb 2024
I will cross check, but I think it should be correct as it is.
If the equations from your above question are correct, it's not correct as is.
You define
f = [Af; Apcm] .*DuDx ;
This means that the thermal diffusivity terms in MATLAB are
d/dx(Af*dTf/dx) = Af*d^2Tf/dx^2 + d/dx(Af) * dTf/dx
d/dx(Apcm*dTs/dx) = Apcm*d^2Ts/dx^2 + d/dx(Apcm) * dTs/dx
and the terms d/dx(Af) and d/dx(Apcm) are not zero because they depend on Tf and Ts.
But you claim your equations read
dTf/dt = Af*d^2Tf/dx^2 - Bf*dTf/dx - Cf(Tf - Ts) and
dTs/dt = Apcm*d^2Ts/dx^2 - Cpcm(Ts - Tf),
not
dTf/dt = Af*d^2Tf/dx^2 + d/dx(Af) * dTf/dx - Bf*dTf/dx - Cf(Tf - Ts) and
dTs/dt = Apcm*d^2Ts/dx^2 + d/dx(Apcm) * dTs/dx - Cpcm(Ts - Tf)

Accedi per commentare.

Risposte (0)

Prodotti


Release

R2012a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by