I am trying to model a simple 2D steady state heat conduction problem using automatically generated Q2 elements.

The problem consists of a square domain with prescribed temperatures along the bottom and left edges defined by

T(x,0)=bcC*x, and

T(0,y)=bcD*y .

The flux along the right edge is defined by


and along the top by

q(x,1)=-2bcAx^2+bcBx+bcD .

Finally, there is a source term defined by

S(x,y)=2bcA(x^2+y^2) .

So far I am having trouble applying all boundary conditions. See for example the (attempted) application of the first temperature boundary condition in the code below.

<< AceFEM`;
(* Define Domain*)
BLx = 0; BLy = 0;
BRx = 1; BRy = 0;
TRx = 1; TRy = 1;
TLx = 0; TLy = 1;
(* Element Densities *)
nX = 2;
nY = 2;
(* BC magnitudes *)
bcD = 10;
bcC = 10;
bcA = 1;
bcB = 2;
(* Initialize Problem *) (* No source term yet *)
  "plate", {"ML:", "TH", "D2", "Q2", "DF", "ST", "Q2", "T", 
   "Fourier"}, {"kt *" -> 1., "QT *" -> 0.} ];
  "Q2", {2, 2}, {{{BLx, BLy}, {BRx, BRy}}, {{TLx, TLy}, {TRx, TRy}}}];
(* Apply BC *)
SMTAddEssentialBoundary[Line[{{BLx, BLy}, {BRx, BRy}}, "T"], 
  1 -> Function[{X, Y}, bcC/(2 nX ) (X - 1)]] ;
(* Solve *)
SMTNextStep["\[Lambda]" -> 1];
While[SMTConvergence[10^-12, 10], SMTNewtonIteration[]; 

Which yields

enter image description here

In which T ranges from 0 to 50 along the bottom instead of 0 to 10 even after scaling the function by the number of nodes.

It may be straight forward enough to scale this function further for this simple BC but how would one apply the more complex flux BCs and source term that vary spatially in a more complex way?

Any help would be appreciated!

  • $\begingroup$ for your concern regarding spatially varying source terms: Why not modelling it via an element-formulation and assigning this additional element to the regions, where you want to have it? I.e., you could model also your load-terms and add them to your discretized domain, where needed. $\endgroup$ – AceUser Feb 10 at 5:53

The syntax is not 1 -> Function[{X, Y}..., but Function[{n,X,Y},... where n is the node number.

  • $\begingroup$ Thanks! Using the command SMTAddEssentialBoundary[Line[{{BLx, BLy}, {BRx, BRy}}, "T"], 1 -> Function[{n, X, Y}, bcC X]]; works as intended $\endgroup$ – DvanHuyssteen May 13 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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