# diffusion on geographic region

Posted 8 years ago
5425 Views
|
|
0 Total Likes
|
 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["NDSolveFEM"] 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"]] 
 I have a first solution Andre Dauphiné enter code hereClearAll["Global*"] Needs["NDSolveFEM"] 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"]]