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 ...


3

If you use diffeqpy you can use the commands adaptive=false,dt=... to specify fixed time stepping. The following is for using the Dormand-Prince RK45 method with fixed time stepping on the Lorenz equation: from diffeqpy import de import matplotlib.pyplot as plt def f(u,p,t): x, y, z = u sigma, rho, beta = p return [sigma * (y - x), x * (rho - z)...


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

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 ...


1

This is speculation, as I do not know the Lipschitz constant or the derivative scales of your simulation. Also, there might be some resonance effect in the interplay of the discrete and continuous parts. But what I would first draw attention to is that the error of RK4 (and any other method) has a V shape in a loglog plot vs. the step size. This is the ...


1

I once worked on this for a bit. It makes a big difference where your data comes from. Typically it will contain errors from experimental data, or is quoted only with finite precision. In such cases do not fit a curve through the points; this will just pick up the errors. It is MUCH better to take a range of data around the point of interest, fit a smooth ...


1

The usual techniques for solving Riemann problem rely on the self-similar structure of the solutions. Some general techniques can be developed which can be applied to any hyperbolic problem. If you add a source term, the self-similarity is lost. Whether you can solve the RP with source term depends on the PDE and the precise form of the source terms, so ...


1

The time evolution equation in hand is $\frac{\partial}{\partial{t}}{u} = L_1(u) + L_2(u)$ where the operators in the RHS are $L_1 = -\frac{\partial}{\partial{x}}{f(u)}$ and $L_2 = g(u)$. The operator splitting techniques consists of doing time steps for the PDE combining two substeps, one using only the first operator in the RHS to produce an intermediate ...


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