Group Abstract Group Abstract

Message Boards Message Boards

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

Modifying Boundary Conditions of Working Code Gives Error

Posted 10 years ago
POSTED BY: Zachary Fata
Needs["DifferentialEquations`InterpolatingFunctionAnatomy`"]
Needs["NDSolve`FEM`"] Needs["NumericalCalculus`"]
length = 50; height = 5;
\[CapitalOmega] = 
  ImplicitRegion[True, {{x, 0, length}, {y, 0, height}}];
RegionPlot[\[CapitalOmega], AspectRatio -> 1/4] // Inactivate;
\[Alpha] = 1; uinf = 1; c = \[Alpha]/uinf;
cellmeasure = 1/10;
iorder = 2;
Tin = 30;
Tbot = 100;
Ttop = 0;
uvalue = NDSolveValue[{D[u[x, y], x] == c D[u[x, y], y, y], 
    u[0, y] == Tin, u[x, 0] == Tbot, u[x, height] == Ttop}, 
   u, {x, y} \[Element] \[CapitalOmega], 
   Method -> {"PDEDiscretization" -> {"FiniteElement", 
       "MeshOptions" -> {"MaxCellMeasure" -> cellmeasure}, 
       "IntegrationOrder" -> iorder}}];
{meshu} = InterpolatingFunctionCoordinates[uvalue]
meshu["Wireframe"]
Export["meshu10.png", meshu["Wireframe"], ImageResolution -> 600]
conPlot = 
 Show[ContourPlot[uvalue[x, y], {x, y} \[Element] \[CapitalOmega], 
   ColorFunction -> "Temperature", Contours -> 25, 
   PlotLegends -> Automatic], AspectRatio -> 1/4]
Export["meshu10_cplot.png", conPlot, ImageResolution -> 600]
px01 = Plot[uvalue[x, height/5], {x, 0, length}, PlotRange -> All]
POSTED BY: Simon Cadrin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard