22 votes
Accepted

Couple a PDE and ODE in NDSolve

Modified Newton Cooling Law implementation and reduced FEA cell length ...
Young's user avatar
  • 7,485
21 votes

Solving Stefan's solidification problem - for the case of 3 regions

Important Update Through a copy-paste mistake, I dropped the temperature dependence on the effective heat capacity, which was the point of the exercise. I have modified the post to correct that ...
Tim Laska's user avatar
  • 16.3k
19 votes
Accepted

How to model diffusion through a membrane?

This answer is a partial response to a comment about extending the approach to more complex geometry. The preliminary results seemed encouraging so I thought I would share my workflow. I think there ...
Tim Laska's user avatar
  • 16.3k
15 votes
Accepted

Total flux of the gradient of the numerical solution of a PDE through a surface

The basic problem appears to be a convective-diffusive heat transfer problem of X-directed fluid flow across a heated spherical cap tip. To study this type of problem, it probably is easier to ...
Tim Laska's user avatar
  • 16.3k
14 votes

PDE with Stefan Conditions, a.k.a variable boundary

On the original question of how to solve classic Stefan-type problems using NDSolve with its high-level syntax (referred to in the posts as 'automatically'). This can be done. Essentially, first ...
alan's user avatar
  • 181
13 votes
Accepted

Solving Stefan's solidification problem - for the case of 3 regions

There is a solution to the problem when the value of the function P1[x,t] on the border does not fall to zero, but to a critical value ...
Alex Trounev's user avatar
  • 43.4k
13 votes
Accepted

How to solve a system of PDEs with zip condition?

This problem is quite similar to PDE with Stefan Conditions, a.k.a variable boundary, and can be solved more easily because now we have DChange and ...
xzczd's user avatar
  • 65.4k
13 votes
Accepted

Reciprocating flow in a channel over a heated surface

We can solve this problem with method proposed on my page. Solution1. We use nondimensional form of equations with scale d and $t_s = d^2/(k_f/(c_p \rho))$. We ...
Alex Trounev's user avatar
  • 43.4k
12 votes
Accepted

Laplace's equation in spherical coordinates with Neumann b.c

Two issues here. First of all, you've chosen 100 to approximate Infinity, which is way too large in this case. Something like <...
xzczd's user avatar
  • 65.4k
11 votes

heat balance solution in two adjacent layers with continuous flux over boundary

Here is a way to do it: ...
user21's user avatar
  • 39.4k
11 votes
Accepted

NDSolveValue - Heat flux continuity

This post contains several code blocks, you can copy them easily with the help of importCode. Pre-v10 Soluion Note: If you're in or after v10, it's recommended ...
xzczd's user avatar
  • 65.4k
11 votes

Analytic solution for 1D heat equation

Here is a full analytical solution derived by hand calculation $$ u\left( x,t\right) =x+24+\sum_{n=1}^{\infty}\frac{8}{\left( 1-2n\right) ^{2}\pi^{2}}\cos\left( \left( n-\frac{1}{2}\right) \pi ...
Nasser's user avatar
  • 142k
11 votes

Solving Stefan's solidification problem - for the case of 3 regions

Inspired by Tim's excellent answer I was wondering if it is not possible to use the FEM for this. In Version 12.0 there is no way to do this from top level. However, we still can solve this phase ...
user21's user avatar
  • 39.4k
11 votes
Accepted

What is wrong with my approach to solving a heat transfer PDE?

I solved this by hand to confirm Maple solution. Since the boundary conditions are not homogeneous, we can't use separation of variables. Let the solution be $$ u=v\left( x,t\right) +r\left( x\...
Nasser's user avatar
  • 142k
11 votes
Accepted

How to handle discontinuity in diffusion coefficient?

Yes, it is possible to solve the equation in a piecewise manner : ...
andre314's user avatar
  • 18.2k
11 votes

How to model diffusion through a membrane?

Here's a solution using pdetoode to discretize the system in $x$ direction. The condition at $x=1$ is then straightforwardly introduced in this approach: ...
xzczd's user avatar
  • 65.4k
10 votes
Accepted

Free Convective Heat Transfer of Non-Newtonian Power Law Fluids from a Vertical Plate

NDSolve-based solution To solve the equation set with NDSolve, we need to resolve several issues: As mentioned by bbgodfrey in ...
xzczd's user avatar
  • 65.4k
10 votes

Total flux of the gradient of the numerical solution of a PDE through a surface

Here are a couple of different ideas for generating the meshes. This works in 12.3 ...
user21's user avatar
  • 39.4k
10 votes
Accepted

question on documentation convention for heat PDE used by Finite Elements methods in Mathematica

There is a sentence in the documentation just above it that says: What follows are some well-known PDEs and their corresponding coefficients. To illustrate the generality of (1), the components that ...
user21's user avatar
  • 39.4k
10 votes

Reciprocating flow in a channel over a heated surface

It seems that the main challenge in this problem is Dirichlet BC which should be switched periodically on $x=0$ and $x=L$. I don't know whether it possible to switch BC inside ...
Oleksii Semenov's user avatar
9 votes
Accepted

How can I solve a 3D heat transfer partial differential equation?

Now that we have your initial conditions, the problem turns out to be simple and not CPU intensive. ...
andre314's user avatar
  • 18.2k
9 votes
Accepted

Moving B.C.s in heat diffusion model

As pointed out in the comment, OP's MATLAB implementation doesn't seem to be correct, so I'll just give a solution to OP's problem. Since the heat flux continuity involves in, there's indeed something ...
xzczd's user avatar
  • 65.4k
9 votes
Accepted

FEM Mesh related errors

This is a bug with time dependent nonlinear NeumannValue introduced in Version 12.0. This is fixed in version 12.1 which is hopefully coming in the not to distant ...
user21's user avatar
  • 39.4k
9 votes
Accepted

Laplace equation with robin boundary conditions

Using DSolve V 12.1 can solve this exactly. ...
Nasser's user avatar
  • 142k
9 votes

How to model diffusion through a membrane?

We can use NDSolve with FEM by changing the variable x->2-x at x>=1 and defining two ...
Alex Trounev's user avatar
  • 43.4k
9 votes

Laplace's equation in spherical coordinates with Neumann b.c

In a previous answer 240190, I showed how one could use anisotropic meshing to add a DirichletCondition at "infinity" for a 1D problem. In this answer, I ...
Tim Laska's user avatar
  • 16.3k
8 votes
Accepted

Analytic solution for 1D heat equation

Here's a analytic solution based on LaplaceTransform, involving an InverseLaplaceTransform. We first correct the trivial syntax ...
xzczd's user avatar
  • 65.4k
8 votes

Mathematica 3D Heat Equation Solution

There are several issue with your code, here is a version that roughly does what you want, though you still need to think about the scale of things. ...
user21's user avatar
  • 39.4k
8 votes
Accepted

Solve a one dimensional heat transfer problem with NDSolve

Since the thermal conductivity is constant, the heat flow and temperature distributions should be symmetric about $x=0.5$. You should be able to convert the source term to a time dependent Neumann ...
Tim Laska's user avatar
  • 16.3k
8 votes
Accepted

Incorrect Result from DSolve for Diffusion IBVP?

Solution given by DSolve is correct, it just can't be verified by naive substitution. This problem is similar to, but a bit more involved than your previous one. ...
xzczd's user avatar
  • 65.4k

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