Re: 2 domain PDE, NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg88623] Re: 2 domain PDE, NDSolve
- From: "jeramyk" <jeramyk at u.washington.edu>
- Date: Sat, 10 May 2008 06:52:06 -0400 (EDT)
- Organization: the University of Washington
- References: <g00v09$gkr$1@smc.vnet.net> <g01bt2$l3u$1@smc.vnet.net>
- Reply-to: "jeramyk" <jeramyk at u.washington.edu>
"Jean-Marc Gulliet" <jeanmarc.gulliet at gmail.com> wrote in message news:g01bt2$l3u$1 at smc.vnet.net... > jeramyk wrote: > >> I'm working on solving the basic 1D, transient heat transfer equation in >> a >> two layer slab configuration. One side is insulated, the other has a >> constant heat flux, and there is not contact resistance between the two >> layers. >> >> My formulation looks like this: >> equation1: T1(0,1)[z,t] == k1/rho1/Cp1*T1(2,0)[z,t] >> equation2: T2(0,1)[z,t] == k2/rho2/Cp2*T2(2,0)[z,t] >> IC1: T1[z,0] == T0 >> IC2: T2[z,0] == T0 >> BC1: T1(1,0)[0,t] == 0 >> BC2: -k1*T2(1,0)[L2+L1,t] == qs >> Match1: k1*T1(1,0)[L1,t] == k2*T2(1,0)[L1,t] >> Match2: T1(1,0)[L1,t] == T2(1,0)[L1,t] >> >> T1[z,t] is solve from 0 to L1, T2[z,t] from L1 to L1+L2. >> >> I've tried NDSolve but it doesn't like the matching conditions (it >> interprets them as BC's and since they're not on the boundary it has >> issue >> with it). > > <snip> > > Please, could you post genuine Mathematica expressions as well as what > you tried with NDSolve? (I believe that by writing T1(0,1)[z,t] you mean > actually Derivative[0, 1][T1][z, t], but I am too lazy today to correct > all the expressions :-) > > Regards, > -- Jean-Marc > You're right, the (0,1) was meant to mean Derivative[0,1]... There was also a typo in BC2. And so the expressions look like this: Derivative[0, 1][T1][z, t] == k1/rho1/Cp1*Derivative[2, 0][T1][z, t] Derivative[0, 1][T2][z, t] == k2/rho2/Cp2*Derivative[2, 0][T2][z, t] T1[z, 0] == T0 T2[z, 0] == T0 Derivative[1, 0][T1][0, t] == 0 -k2*Derivative[1, 0][T2][0, t] == qs k1*Derivative[1, 0][T1][L1, t] == k2*Derivative[1, 0][T2][L1, t] What I plugged into NDSolve looks like this... Dummy values for the coefficients: L1=0.005; L2=0.001; k1=10; k2=1; rho1=1; rho2=2; Cp1=1; Cp2=2; T0=10; qs=1000; Attempt at a solution: solution = NDSolve[ {Derivative[0,1][T1][z,t]==k1/rho1/Cp1*Derivative[2,0][T1][z,t], Derivative[0,1][T2][z,t]==k2/rho2/Cp2*Derivative[2,0][T2][z,t], T1[z,0]==T0, T2[z,0]==T0, Derivative[1,0][T1][0,t]==0, -k2*Derivative[1,0][T2][0,t]==qs, k1*Derivative[1,0][T1][L1,t]==k2*Derivative[1,0][T2][L1,t], T1[L1,t]==T2[L1,t]}, {T1,T2},{z,0,L1+L2},{t,0,10}] and the error is: NSSOLVE::bcedge : Boundary condition 10T1(1,0)[0.005,t]=T2(1,0)[0.005,t] is not specified on a single edge of the boundary of the computational domain.