Dec 4, 2019 15:26
@user162281 We did not check it with theorems. We have seen that equation with those boundary conditions many times and we just know it's a well-posed problem.
Dec 4, 2019 15:24
Interesting! I don't know what those bars mean...? The Neumann conditions behave in a similar way, because, since the condition is set to 0, the 1st order boundary condition is actually second order accurate.
Nov 28, 2019 18:38
I started to provide an answer. I got stuck between 2 options (and posted a question: scicomp.stackexchange.com/questions/33902/…). Once done, I'll come back here lol. Anyways, you should not have D^{n+1/2}. It should be D^n or D^{n+1}. C-N is based on the trapezoidal rule. Also, the Neumann boundary conditions, if you simply set f_{6+dx} equal to f_{6-dx}, you should be able to calculate f_6. Is that what you are doing?
Nov 28, 2019 18:38
@RThompson. Good to hear. It would be nice to contrast with my answer.
Nov 28, 2019 18:38
Tried to formulate your problem. I see now what you mean, apologies. In FEM, a 0 neumann condition is equivalent to removing a term in the discretized formulation, and nothing has to be done numerically.
Nov 28, 2019 18:38
C-N is the method you use to discretize. N-R is for solving nonlinear problems. Btw, yours is not nonlinear (I thought MMS would make it nonlinear but I was wrong...), so no N-R needed...
Nov 28, 2019 18:38
@RThompson what do you mean? It's a non-linear system of equations. You solve it with Newton-Raphson or similar. And you don't impose anything on x=6. Also, I think you should evaluate D at t and t+1, not t+1/2. Crank Nicholson is based on a trapezoidal rule. en.m.wikipedia.org/wiki/Crank%E2%80%93Nicolson_method
Nov 28, 2019 18:38
@RThompson I still fail to see why you need to impose anything on x=6 if it is satisfied naturally?
Nov 28, 2019 18:38
df=0 at x=6 satisfies naturally. Just leave out the part od the ghost points and all should be fine.
 
Aug 5, 2019 16:25
I added a second edit to the question to make convection at the boundary clear. I hope everything is clear now.
Aug 5, 2019 16:25
It is unusual to have thermal convection within a solid material indeed :). But that is how you model diffusion convection WITHIN a material.
Aug 5, 2019 16:25
Anyways, what I said before: with convection, you surely mean convection at the surface of the material.
Aug 5, 2019 16:25
Aug 5, 2019 16:25
Strictly speaking, the standard heat equation does not involve convection, but only diffusion. I understand that, each time you speak of convection, you refer to the term h(T-Tsur), which we used to impose on the Neumann boundary. If you want heat convection within the material, you'll need another differential equation (not the standard heat equation).
Aug 5, 2019 16:25
Your convection term is a Neumann boundary condition. After the weekend I'll edit my answer to make that clear.
Aug 5, 2019 16:25
Edit1 step1: you still haven't corrected the sign: dTdt - kd^2T/dx^2 = 0. Your procedure from edit2 is now understandable and seems ok! I feel I don't have to edit my answer, as the question about the convergence problem is the same.
Aug 5, 2019 16:25
It is correct. Concerning k=0 and being physically correct or not, I think I addressed those issues clearly in my answer. And as last edit in my answer, I said it should not matter even if you use non-zero 0 with zero k.
Aug 5, 2019 16:25
Maybe you mean that you impose -k grad(T) = h(T-Tsur) on the Neumann boundary? That is a valid choice. With a (alpha), it would be: q(t) = -a grad(T) = h(T-Tsur)/(rho*cp). But, allow me to insist, k=0 and h=0 are inconsistent.
Aug 5, 2019 16:25
I'm not sure what you mean. Also, what is n? Do you mean you don't want to solve the standard Heat Equation? Maybe you could post another question with the exact differential equation you want to solve?