4

When dealing with conservation laws like your case, you can often make use of the divergence theorem (as you did). You can then express the fact that the total mass within your integration region is preserved by the following surface integral: $$\oint_{\partial \Omega} k \nabla T \cdot \mathbf{n} ~\partial S = 0$$ Now, as it stands, it is irrelevant which ...


4

The solution to the final Poisson equation is defined only up to an additive constant. So you just need to shift the solution vector so the smallest value is zero.


3

Expanding (sort of) on @MPIchael's answer, you can pick any smooth function you like and plug it into the heat equation to give a problem to then work the other way. In numerical methods, we call this the Method of Manufactured Solutions, and it is used extensively for verifying computer programs designed to simulate PDEs. You'll have to add a forcing ...


2

An extended answer. For more arbitrary meshes you have to consider that generally CFD/FEM solvers rely on generic data-structures with element and side lists: Element list Side list Consider the following pictures, which is the standard case for simple Cartesian meshes. Since there is a single plus and a single minus side on each face, the definition is ...


2

Because a heat flux has a direction, and from what you are describing, you are adding a heat flux in the normal direction -- out of the domain. So if you started with a constant temperature plane and they draw heat out of it, you'd end up with a negative temperature.


2

Normal direction depends on the cell that you are writing equation for. the word outward is relative to the cell under study. In order to write equation for each of cells, i.e. $\Sigma \nabla T.n S_f=0$, stick to this : $\nabla T_{face}=\frac{T_c-T_i}{r_c-r_i}$ and assume $n$ as outward pointing normal vector for that face. I think your problem is that you ...


2

TL DR: $$u_1(x_1) = \cos(2\pi~(\frac{x_1}{L_1}) - \pi) + 1$$ $$u_2(x_2) = \cos(2\pi~(\frac{x_2}{L_2}) - \pi) + 1$$ $$u(x,t) = \exp(-a t) u_1(x_1) u_2(x_1)$$ How to construct it: Sines and cosines are easily differentiable so they make a good starting point to construct such a solution. We chose a section and offset of the cosine which has a derivative of ...


1

The applied division is fine, what went wrong here, is the application of Stoke's theorem. If you multiply with the test function you get following term: $$\int \frac{1}{c_p}\nabla\left(-k\nabla u\right) v d\Omega$$ But $$\int \frac{1}{c_p}\nabla\left(-k\nabla u\right) v d\Omega \neq \int \frac{1}{c_p} \left(k\nabla u\right) \cdot \left(\nabla v\right) d\...


1

For a linear PDE, like the Laplace equation, when you discretize it you should get a linear system. Since you're 1D, the Thomas algorithm should be able to solve the system, and it's executed by running over the system once; Thomas algorithm is a direct solver, not an iterative one. If I understand your question correctly, you're asking what happens if you ...


Only top voted, non community-wiki answers of a minimum length are eligible