1
$\begingroup$

I want to simulate heat conduction (and advection) through an annulus and its surrounding material in 2D, as illustrated in this mesh:2 subregions with different parameters

For the heat conduction, I want two Dirichlet boundary conditions, one is a constant = 45 at the inner side of the annulus , one is a constant = 12 at the outer edge of the yellow region . There is an overarching heat conduction equation that dictates heat conduction/advection in both materials. In the gray region I set the advection term to 0. In the yellow region there is both conduction and advection.

It seems to me that the result shows heat is not diffusing out into the yellow region, which I don't know how to fix. I tried to change the velocity of advection and other parameters. It doesn't make any difference. snapshot of the scalar field of temperature

Here is what I have so far.

hole = ((x - 2.5)^2 + (y - 2.5)^2 ) <= 0.09;
rock = (((x - 2.5)^2) + ((y - 2.5)^2 ) >= 0.25) && (0 <= x <= 
 5) && (0 <= y <= 5);
crds = {2.5, 2.5};
Ω1 = ImplicitRegion[Or[hole, rock], {{x, 0, 5}, {y, 0, 
5}}];
mesh1 = ToElementMesh[Ω1, "RegionHoles" -> crds, 
"RegionMarker" -> {{{2.48, 2.898}, 10, 0.01}, {{0.1, 0.1}, 
20,0.01}}];
mesh1["Wireframe"["MeshElementStyle" -> 
{FaceForm[Gray],FaceForm[Yellow]}]]

σ = If[ElementMarker == 10, 1, 5.953961813842482];
u = If[ElementMarker == 10, 0, 0];
α = If[ElementMarker == 10, 
2.829654782116582`*^-7,5.026491646778043`*^-7];
q = If[ElementMarker == 10, 0, 0.1];


tempRateOp = σ*\!\(
\*SubscriptBox[\(∂\), \(t\)]\(T[t, x, y]\)\) + u*\!\(
\*SubscriptBox[\(∂\), \(x\)]\(T[t, x, y]\)\) - α*\!(
\*SubsuperscriptBox[\(∇\), \({x, y}\), \(2\)]\(T[t, x, y]\)\) - 
q/Subscript[(Subscript[ρc, p]), f]

Subscript[Γ, D] = {DirichletCondition[T[t, x, y] == 45, 
((x - 2.5)^2 + (y - 2.5)^2 ) <= 0.09],DirichletCondition[T[t, x, y]== 
12, x == 0 || x == 5 || y == 0 || y == 5]};

ufunTemp = NDSolveValue[{tempRateOp == 0, Subscript[Γ, 
D], T[0, x, y] == 12}, T, {t, 0, 5000}, {x, y} ∈ mesh1]
$\endgroup$
3
  • 2
    $\begingroup$ Please, provide the code in a InputForm. Something must have gone wrong with with the SubscriptBoxes. I cannot execute the code. $\endgroup$ Commented Jul 27, 2018 at 18:47
  • 1
    $\begingroup$ Parameters Subscript[(Subscript[\[Rho]c, p]), f] are not defined. In which version of Mathematica was this code tested? $\endgroup$ Commented Jul 28, 2018 at 4:10
  • $\begingroup$ Henrik Schumacher: sorry for the inconvenience next time I will make sure that the code is in InputForm. Alex Trounev: This is written in Mathematica 11.3.0. $\endgroup$
    – alan
    Commented Jul 28, 2018 at 18:51

1 Answer 1

2
$\begingroup$

The scale multiplier $10^{-7}$ should be included in the definition of time.I checked the statement that two models in which 2 or 1 discontinuous functions are used give different results. Therefore, I leave the version of the problem statement proposed by the author of the topic. Then the task is solved using the code

 tm = 5;
\[CapitalOmega]1 = 
  ImplicitRegion[(x - 2.5)^2 + (y - 2.5)^2 >= 0.09 && (0 <= x <= 
       5) && (0 <= y <= 5), {x, y}];
\[Sigma] [x_, y_] := 
 Piecewise[ {{1, .09 <= ((x - 2.5)^2) + ((y - 2.5)^2 ) <= 0.25}, { 
    5.95396, ((x - 2.5)^2) + ((y - 2.5)^2 ) >  0.25}}]
u [x_, y_] := 0;
\[Alpha] [x_, y_] := 
 Piecewise[ {{2.82965, .09 <= ((x - 2.5)^2) + ((y - 2.5)^2 ) <= 
     0.25}, {5.02649, ((x - 2.5)^2) + ((y - 2.5)^2 ) >  0.25}}] 
q [x_, y_] := 
 Piecewise[{{0, .09 < ((x - 2.5)^2) + ((y - 2.5)^2 ) < 0.25}, { 
    1, ((x - 2.5)^2) + ((y - 2.5)^2 ) >  0.25}}]
eq = \[Sigma] [x, y]* D[T[t, x, y] , t] - \[Alpha][x, y]*
     Laplacian[T[t, x, y], {x, y}] - q[x, y] == 0;
Subscript[\[CapitalGamma], D] = {DirichletCondition[T[t, x, y] == 45, 
    ((x - 2.5)^2 + (y - 2.5)^2 ) == 0.09], 
   DirichletCondition[T[t, x, y] == 12,  
    x == 0 || x == 5 || y == 0 || y == 5]};
Temp = NDSolveValue[{eq, Subscript[\[CapitalGamma], 
     D], T[0, x, y] == 12}, 
   T, {t, 0, tm}, {x, y} \[Element] \[CapitalOmega]1, 
   Method -> {"FiniteElement", "InterpolationOrder" -> {T -> 2}, 
     "MeshOptions" -> {"MaxCellMeasure" -> 0.001}}];
Table[ContourPlot[Temp[t, x, y], {x, y} \[Element] \[CapitalOmega]1, 
  Contours -> 20, ColorFunction -> "TemperatureMap", 
  PlotLegends -> Automatic, PlotRange -> All, 
  PlotLabel -> Row[{"t=", t}]], {t, .1*tm, tm, .3*tm}]

fig2

Let us compare two models

eq1 = D[T[t, x, y] , 
     t] - (\[Alpha][x, y]*Laplacian[T[t, x, y], {x, y}] - 
       q[x, y])/\[Sigma][x, y] == 0;
eq2 = \[Sigma][x, y]*D[T[t, x, y] , t] - \[Alpha][x, y]*
     Laplacian[T[t, x, y], {x, y}] - q[x, y] == 0;

The first model I published and deleted, so as not to cause controversy. Interestingly, the two models give different results. fig3

$\endgroup$
4
  • $\begingroup$ I'm sorry, but it's incorrect to "merge" the 2 discontinuous coefficients, because this will ruin the heat flux continuity. Check this post for more detail. $\endgroup$
    – xzczd
    Commented Jul 28, 2018 at 6:51
  • $\begingroup$ xzczd I thank you for the valuable observation about the correct use of discontinuous coefficients. Of course, with the correct formulation it is necessary to solve the conjugate problem for each region and use the heat transfer equation in the divergent form. However, to demonstrate the method of solution is quite enough and what I used. I leave the question of correctness open. $\endgroup$ Commented Jul 28, 2018 at 7:55
  • $\begingroup$ Thank you Alex Trounev for answering my question! This is very very helpful for what I'm working on. Could you clarify what you mean by "the scale multiplier 10^−7 should be included in the definition of time"? I couldn't fine this line in your code. $\endgroup$
    – alan
    Commented Jul 28, 2018 at 18:48
  • $\begingroup$ Alex Trounev: I got it now. Including the scalar multiplier in the definition of time makes much more sense computation-wise. $\endgroup$
    – alan
    Commented Jul 28, 2018 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.