Solve 1D heat equation with a non-initial/boundary condition?

I’ve been trying different ways to Use NDSolve for my calculation:

in which I’m trying to find the constant k (rho and Cp are known). Anyway I’ve tried I get the error:
“Boundary condition is not specified on a single edge of the boundary of the computational domain.”

When not including the the problematic condition I got an “Interpolation Function” but still wasn’t able to retrieve k (using Solve or FindRoot).
Here’s my code:

ClearAll["Global'*"]
rho=2200; cp=700; ay=1/(rho*cp);

pde =( D[T[t,x,k], {x, 2}] )*ay*k == D[T[t, x,k], t];
bc = { T[t, 0,k] == 373 , T[0, x,k] == 303, T[120,1,k]==338};

 sol=NDSolve[{pde, bc},T,{x,0,1},{t,0,120},{k,0,100}] 

err.png

Any Help would be greatly appreciated.

The solution for the heat equation can be written

fT = TT0 + (Tinfi - TT0) Erfc[x/(2 Sqrt[a t])]

D[fT, t] - a D[fT, x, x] // Simplify

In your case

fT = 30 + (100 - 30) Erfc[x/(2 Sqrt[a t])]

Make a Plot of fT as function of x after 120 secs ( t → 120 ) for variable a and find that for a = 0.0092 your condition is fulfilled:

Manipulate[
 Plot[Evaluate[fT /. {a -> aa, t -> 120}], {x, 0, 4}, 
  PlotRange -> {0, 100}, Epilog -> {PointSize[.02], Point[{1, 65}]}],
 {aa, 0.001, 0.1}]

I hope this helps. My best wishes for the new year.

Thank you for the response! Could you please elaborate on how you’ve reached
the function Erfc?

It might be that you would like to look into this book

You can achieve the given solution by the method of Laplacetransformation. This gives an ODE instead of the PDE for heat-transport. I will try to line it out.

Write the heat equation ( PDE )as

heateq = D[fT[x, t], t] - a D[fT[x, t], x, x]

and do a Laplace Transform

LaplaceTransform[heateq, t, s]

Now note that LaplaceTransform[fT[x, t], t, s] is a function of x only, we have an ordinary differential equation. Substituting LaplaceTransform[fT[x, t], t, s] with fTL[x] rewrite the ODE and solve for fTL

sol = DSolve[-T0 + s fTL[x] - a D[fTL[x], x, x] == 0, fTL[x], x] // Flatten

and get

fT1 = fTL[x] /. sol

fT1 has to be bounded (not grow above all limits for growing x ), so C[1] has to be 0

fT2 = fT1 /. C[1] -> 0

and for x = 0 your solution has to be T1 ( in the L-regions this is T1/s ),

cond = (fT2 /. x -> 0) == T1/s

this gives the value for C[2] and the final result (in L-space)

fT3 = fT2 /. (Solve[cond, C[2]] // Flatten)

Now transform your result back into the time-domain (which may be next to impossible)

fxt = Simplify[InverseLaplaceTransform[fT3, s, t], x > 0 && a > 0]

and get the result you asked for.