In[]:=
​
In[]:=
​
In[]:=
(*Triangulatelement*)​​Needs["NDSolve`FEM`"]​​Ω=ImplicitRegion[True,{{x,0,1},{y,0,1}}]​​RegionPlot[Ω,AspectRatio->Automatic]​​A=Rotate[Ω,15Degree,{0,0}]​​mesh=ToElementMesh[A]​​mesh["Wireframe"]
Out[]=
ImplicitRegion[0≤x≤1&&0≤y≤1,{x,y}]
Out[]=
Out[]=
ParametricRegion
(1+
3
)x
2
2
-
(-1+
3
)y
2
2
,
(-1+
3
)x
2
2
+
(1+
3
)y
2
2
,0≤x≤1&&0≤y≤1,{x,y}
Out[]=
ElementMesh[{{-0.258819,0.965926},{0.,1.22474}},{TriangleElement[<412>]}]
Out[]=
In[]:=
​​​​​​eq1={u[x,y],v[x,y]}.Inactive[Grad][u[x,y],{x,y}]+Inactive[Div][{p[x,y],0},{x,y}]-Pr*Inactive[Div][{Derivative[1,0][u][x,y],Derivative[0,1][u][x,y]},{x,y}]​​eq2={u[x,y],v[x,y]}.Inactive[Grad][v[x,y],{x,y}]+Inactive[Div][{0,p[x,y]},{x,y}]-Pr*Inactive[Div][{Derivative[1,0][v][x,y],Derivative[0,1][v][x,y]},{x,y}]-Pr*Ra*θ[x,y]​​eq3=Derivative[1,0][u][x,y]+Derivative[0,1][v][x,y]​​eq4={u[x,y],v[x,y]}.Inactive[Grad][θ[x,y],{x,y}]-Inactive[Div][{Derivative[1,0][θ][x,y],Derivative[0,1][θ][x,y]},{x,y}]​​Pr=0.71;Ra=10^3;​​OP={eq1==0,eq2==0,eq3==0,eq4==0}​​bc={DirichletCondition[θ[x,y]==1,-3.73x],DirichletCondition[θ[x,y]==0,3.86-3.73x],DirichletCondition[{u[x,y]==0,v[x,y]==0},True],DirichletCondition[p[x,y]==0,-3.73x||0.267x]}​​{u,v,p,θ}=NDSolveValue[{OP,bc},{u[x,y],v[x,y],p[x,y],θ[x,y]},{x,y}∈mesh,Method->{"FiniteElement","InterpolationOrder"->{u->2,v->2,p->1,θ->2}}]​​ContourPlot[θ,{x,-1,1},{y,0,1.5}]​​
Out[]=
{u[x,y],v[x,y]}.
∇
{x,y}
u[x,y]+
∇
{x,y}
·{p[x,y],0}-Pr
∇
{x,y}
·
(1,0)
u
[x,y],
(0,1)
u
[x,y]
Out[]=
{u[x,y],v[x,y]}.
∇
{x,y}
v[x,y]-PrRaθ[x,y]+
∇
{x,y}
·{0,p[x,y]}-Pr
∇
{x,y}
·
(1,0)
v
[x,y],
(0,1)
v
[x,y]
Out[]=
(0,1)
v
[x,y]+
(1,0)
u
[x,y]
Out[]=
{u[x,y],v[x,y]}.
∇
{x,y}
θ[x,y]-
∇
{x,y}
·
(1,0)
θ
[x,y],
(0,1)
θ
[x,y]
Out[]=
{u[x,y],v[x,y]}.
∇
{x,y}
u[x,y]+
∇
{x,y}
·{p[x,y],0}-0.71
∇
{x,y}
·
(1,0)
u
[x,y],
(0,1)
u
[x,y]0,{u[x,y],v[x,y]}.
∇
{x,y}
v[x,y]-710.θ[x,y]+
∇
{x,y}
·{0,p[x,y]}-0.71
∇
{x,y}
·
(1,0)
v
[x,y],
(0,1)
v
[x,y]0,
(0,1)
v
[x,y]+
(1,0)
u
[x,y]0,{u[x,y],v[x,y]}.
∇
{x,y}
θ[x,y]-
∇
{x,y}
·
(1,0)
θ
[x,y],
(0,1)
θ
[x,y]0
Out[]=
{DirichletCondition[θ[x,y]1,-3.73x],DirichletCondition[θ[x,y]0,3.86-3.73x],DirichletCondition[{u[x,y]0,v[x,y]0},True],DirichletCondition[p[x,y]0,-3.73x||0.267x]}
Out[]=
InterpolatingFunction
Domain: {{-0.259,0.966},{0.,1.22}}
Output: scalar
[x,y],InterpolatingFunction
Domain: {{-0.259,0.966},{0.,1.22}}
Output: scalar
[x,y],InterpolatingFunction
Domain: {{-0.259,0.966},{0.,1.22}}
Output: scalar
[x,y],InterpolatingFunction
Domain: {{-0.259,0.966},{0.,1.22}}
Output: scalar
[x,y]
Out[]=
In[]:=
Show[RegionPlot[A,PlotStyle->LightBlue],Plot[{-3.73x,3.86-3.73x,0.267x},{x,-1,1},PlotStyle->{Red,Green,Blue}]]
Out[]=
In[]:=
Show[RegionPlot[A,PlotStyle->LightBlue],Plot[-3.73x,{x,-1,1},PlotStyle->{Red}]]
Out[]=