Message Boards Message Boards

0
|
6285 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

diffusion on geographic region

I built a model to simulate the spread of a phenomenon in France from Paris. I use FEM. But I do not know what Dirichet or Newman boundary conditions I must apply. My small program. Do you have a solution? André Dauphiné

ClearAll["Global`*"]
Needs["NDSolve`FEM`"]
carto = DiscretizeGraphics[
   CountryData["France", {"Polygon", "Mercator"}]];
bmesh = ToBoundaryMesh[carto, "MaxBoundaryCellMeasure" -> 25, 
   AccuracyGoal -> 1];
mesh = ToElementMesh[bmesh, MaxCellMeasure -> 5, 
  "MaxBoundaryCellMeasure" -> 25]
mesh["Wireframe"]
op = \!\(
\*SubscriptBox[\(\[PartialD]\), \(t\)]\(u[t, x, y]\)\) - 
   Inactive[Laplacian][u[t, x, y], {x, y}] - 20;
dc = DirichletCondition[u[t, x, y] == 0, x == 0 && 8 <= y <= 10];
nc = NeumannValue[-2*u[t, x, y], (-5 + x)^2 + (-5 + y)^2 == 9];
uifHeat = 
  NDSolveValue[{op == nc, dc, u[0, x, y] == 0}, 
   u, {t, 0, 100}, {x, y} \[Element] mesh];
Show[ContourPlot[uifHeat[x, y], {x, y} \[Element] mesh, 
  ColorFunction -> "Temperature"], bmesh["Wireframe"]]
POSTED BY: André Dauphiné

I have a first solution Andre Dauphiné

enter code hereClearAll["Global`*"]
Needs["NDSolve`FEM`"]
carto = DiscretizeGraphics[
   CountryData["France", {"Polygon", "Mercator"}]];
bmesh = ToBoundaryMesh[carto, "MaxBoundaryCellMeasure" -> 25, 
   AccuracyGoal -> 1];
mesh = ToElementMesh[bmesh, MaxCellMeasure -> 5, 
  "MaxBoundaryCellMeasure" -> 25]
mesh["Wireframe"]
op = -Laplacian[u[x, y], {x, y}] - 20;
usol = NDSolveValue[{op == 1, DirichletCondition[u[x, y] == 0, True]},
   u, {x, y} \[Element] mesh]
Plot3D[usol[x, y], {x, y} \[Element] mesh]
Show[ContourPlot[usol[x, y], {x, y} \[Element] mesh, 
  ColorFunction -> "Temperature"], bmesh["Wireframe"]]
POSTED BY: André Dauphiné
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract