Group Abstract Group Abstract

Message Boards Message Boards

Problem about how to find a length related to the Nusselt number

Posted 2 years ago

I have to find the value of z that correspond to Nu=NuInfinity *1.05, where Nuinfinity=3.657, and the nusselt number is:

Nulocal[z_] := 2*(D[solT[0, 1, z], y])/(solT[0, 1, z] - Tb[z])

Here is the code that i wrote, but it doesn't work:

geo = ImplicitRegion[x^2 + y^2 <= 1, {x, y}];

equa = {2*(1 - (x^2 + y^2))*D[T[t, x, y], {t, 1}] == 
    D[T[t, x, y], {x, 2}] + D[T[t, x, y], {y, 2}], 
   DirichletCondition[T[t, x, y] == 1 - E^(-1000*t), x^2 + y^2 == 1], 
   T[0, x, y] == 0};

solT = NDSolveValue[equa, T, {t, 0, 1}, {x, y} \[Element] geo, 
   Method -> {"PDEDiscretization" -> {"FiniteElement", 
       "MeshOptions" -> {"MaxCellMeasure" -> 0.001}}}];

Tb[z_] := 
  4*NIntegrate[y*(1 - y^2)*solT[0, 1, z], {y, 0, 0.99}, 
    WorkingPrecision -> 20];

Nulocal[z_] := 2*(D[solT[0, 1, z], y])/(solT[0, 1, z] - Tb[z])


desiredValue = 3.657*1.05;

zValue = z /. FindRoot[Nulocal[z] == desiredValue, {z, zGuess}]
POSTED BY: Fredom W.
3 Replies
Posted 2 years ago
POSTED BY: Otto Linsuain
Posted 2 years ago
POSTED BY: Otto Linsuain
Posted 2 years ago

thanks for the help, i changed the code:

Clear[Tb]
Clear[Nulocal]

geo = Disk[];

equa = {2*(1 - (x^2 + y^2))*D[T[t, x, y], {t, 1}] == 
    D[T[t, x, y], {x, 2}] + D[T[t, x, y], {y, 2}], 
   DirichletCondition[T[t, x, y] == 1 - Exp[-1000*t], x^2 + y^2 == 1],
    T[0, x, y] == 0};

solT = NDSolveValue[equa, T, {t, 0, 1}, {x, y} \[Element] geo, 
   Method -> {"PDEDiscretization" -> {"FiniteElement", 
       "MeshOptions" -> {"MaxCellMeasure" -> 0.001}}}];


Tb[z_?NumericQ] := 
  4*NIntegrate[y*(1 - y^2)*solT[0, 0, 1], {y, 0, 0.99}, 
    WorkingPrecision -> 3, MinRecursion -> 2, AccuracyGoal -> 10];

Nulocal[z_?NumericQ] := 
  With[{derivative = 
     D[solT[0, 0, y], y] /. y -> 1}, (2*derivative)/(solT[0, 0, 1] - 
      Tb[z])];

desiredValue = 3.657*1.05;
zGuess = 1;
zValue = z /. FindRoot[Nulocal[z] == desiredValue, {z, zGuess}];

but it gives me this error: FindRoot::jsing: Encountered a singular Jacobian at the point {z} = {1.}. Try perturbing the initial point(s).

POSTED BY: Fredom W.
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard