Tag Info

11

3 issues here, I'll start from the simplest one. First of all, to solve the problem inside an annulus, you need to tell NDSolve you're solving inside an annulus in some way. The simplest approach is to stay in Cartesian coordinate and choose a Annulus[…] region: nsolref = NDSolveValue[{Laplacian[u[x, y], {x, y}] == 0, DirichletCondition[u[x, y] == Sin[...

10

You can not really. The fact that Interpolation can do this hinges on the data being structured. In other works what I am going to show next is not easily generally possible for meshes that represent a non rectangullar domain; which is the common case for FEM meshes. You can hack it by using the ExtrapolationHandler option. Needs["NDSolveFEM"]...

8

In my extended comment to the question MeshRefinementFunction on 2D surfaces embedded in 3D, I showed that MaxCellMeasurecould be applied to 2D surfaces embedded in 3D, but that the MeshRefinementFunction seems to be ignored. A potential workaround is to use the functionality in FEMAddOns to join two boundary meshes meshed at different resolutions. A sample ...

7

As a workaround you can use the finite element mesh generator: Needs["NDSolveFEM"] coordinateList = Tuples[{Range[3], Range[3], Range[3]}]; MeshRegion[ToElementMesh[coordinateList], PlotTheme -> "Lines"]

7

"Infinite domains" with anisotropic meshing I will demonstrate an approach that extends the domain by a factor of a thousand with a small increase in computational cost through anisotropic meshing. I will verify the approach using heat transfer in an infinite rod where the analytical solution is known. Helper functions I will use some of the ...

6

Try: L = 50; M = 0.2; g[x_] := Piecewise[{{1, x < L/2}, {0, x >= L/2}}]; pdeSec = D[uSec[x, t], t] - D[D[uSec[x, t], t], t]/2 - M ( D[D[uSec[x, t], x], x] + D[uSec[x, t] (1 - uSec[x, t]), x]) == 0; solSec = NDSolve[{pdeSec, uSec[x, 0] == g[x], uSec[0, t] == 1, uSec[L, t] == 0}...

6

I think you betw data is a bit messed up. I show you how to work around that. We ignore betw and in stead ad a line connecting the str and mcr boundaries = {mcr, betz, st, air}; Needs["NDSolveFEM"] bms = Join[ ToBoundaryMesh /@ boundaries, {ToBoundaryMesh[ "Coordinates" -> {{0.447, 0.868}, {0.483, 0.868}}, &...

5

One can define an "infinite" domain-based solely on $t_{max}$ for a purely diffusive problem. The key disadvantage of using this approach versus anisotropic meshing is that the mesh will change as a function of $t_{max}$ and $\mathcal{D}$. The analytical solution for one-dimensional diffusion is: \frac{{{C_A}\left( {t,x} \right)}}{{{C_{A0}}}} = ...

5

For 2D time dependent incompressible flow we can use linear FEM, as it discussed on Solver for unsteady flow with the use of the Navier-Stokes and Mathematica FEM. This solver has been tested and compared with other different approaches. The linear FEM solver shows also nice solution for the problem for turbulent like initial data. We use as initial data the ...

5

We can solve this problem using FEM and implicit Euler in a Case 1, 2, 4 from the report Option Pricing under a Heston Volatility model using ADI schemes by Jieshun Luo, Qi Wang, Nestor Carbayo. Case 3 looks very tricky, so I can't handle it with my code. First we map region $0\le s\le 800, 0\le v\le 5$ to unit square by substitution $x=s/L_x,y=v/L_y$ with \$...

5

Also you can it try this way with version 12.2 sol = NDSolveValue[{D[u[t, x], t] + DiffusionPDETerm[{u[t, x], {x}}] == 0, u[0, x] == (Sin[Pi*x])^100}, u, {x, 0, 1}, {t, 0, 2}] Plot3D[sol[t, x], {x, 0, 1}, {t, 0, 0.1}, PlotRange -> All] To complete this, the following addition: heatSol = NDSolveValue[{HeatTransferPDEComponent[{u[t, x], t, {x}}, <...

5

Here is an idea that works in 2D (not sure if it is going to work in 3D) First we generate a mesh with a MeshRefinementFunction f2d = Function[{vertices, area}, Block[{x, y}, {x, y} = Mean[vertices]; If[x > 0 && area > 0.001, True, False]]]; m = ToElementMesh[Disk[], MeshRefinementFunction -> f2d]; Then we extract the boundary mesh from ...

4

This is nothing compared to @Tim Laska's detailed answer above, but I found that a quickfire way of removing the small slivers from the geometry was to use the option MaxCellMeasure -> Infinity while turning the region into a mesh, as such: mr = DiscretizeRegion[regionCones, MaxCellMeasure -> Infinity] giving me This works probably because the ...

4

Anisotropic Meshing The following is a feature request for anisotropic meshing. A proper mesh is as or more important than just having the proper equations to obtain accurate simulation results. The problem arises when one needs to capture either very close or very far away from some feature in the main model. Naïvely meshing the model with the uniform mesh ...

3

Like shown in the comments by Henrik, you'd need to refine the mesh H1[ρ_, m_, l_] := R''[ρ] + 1/ρ*R'[ρ] - (m + 1)/l^2*R[ρ] - m^2/ρ^2*R[ρ] - ρ^2/(4*l^4)*R[ρ]; H1test = H1[ρ, 1, 1]; {PapEvals, PapEvecs} = NDEigensystem[{-H1test, DirichletCondition[R[ρ] == 0, True]}, R[ρ], {ρ, 0, 50}, 5, Method -> {"PDEDiscretization" -> {"...

3

Here is something to get you started. dA = 1; dB = 1; ka = 1; kc = 1; cAbulk = 1; eqn1 = D[cA[x, t], t] - Inactive[Div][dA Inactive[Grad][cA[x, t], {x}], {x}]; eqn2 = D[cB[x, t], t] - Inactive[Div][dB Inactive[Grad][cB[x, t], {x}], {x}]; large = 10; {ncA, ncB} = NDSolveValue[{eqn1 == NeumannValue[kc cA[x, t] - ka cB[x, t], x == 0], cA[...

3

"startup aid" U = NDSolveValue[{Derivative[0, 1][u][x, t] ==Derivative[2, 0][u][x, t], u[x, 0] == Sin[Pi x]^100 }, u, {t, 0, 1}, {x, 0, 1} , Method -> {"MethodOfLines", "TemporalVariable" -> t,"SpatialDiscretization" -> "FiniteElement" }] NDSolveValue evaluates the solution U[x,t] as an ...

3

I'm posting this as an answer only because it is good enough for my requirements at the moment. I have taken the code provided by Alex Trounev in the first answer and modified it to decay the two dirichlet conditions in time. As the top and bottom velocities decay, the flow starts resembling 2D channel flow (as the top and bottom effectively approach the no ...

2

Since currently ElementMeshInterpolation does not support PeriodicInterpolation and Interpolation only support PeriodicInterpolation on rectangular grid. Apart from user21's workaround, I developed a workaround for arbitrary parallel or parallelipiped grid periodic interpolation. The idea is naive, just to pull back points outside region by base vectors. ...

1

As Tim pointed out in the comments, the LineElement is a finite element. If you open the ref page of LineElement and click on the "Details" section, you will find more information. Alternatively you can paste this LineElement#921078465 in your help system.

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