5
$\begingroup$

I am trying to apply a time dependent load in AceFEM, for which i have used adaptive time method for analysis, also i need it to be applied at the nodal points from 1 to 15. So i have used natural boundary condition and gave the command but have encountered error that my "Boundary condition is not of prescribed form". Please guide me

<< AceFEM`;
SMTInputData[];
P = 1000000; 
SMTAddDomain["Ω","ML:SEPET1DFLET1DHooke", {"E *" -> 1000, "ν *" -> 0.3}];
SMTAddMesh[ToElementMesh[
  ImplicitRegion[x^2 + y^2 > 0.05, {x, y}],
 {{-3, 3}, {-3, 3}},"MeshOrder" -> 1], "Ω"
];
Clear[λ];
λ[t_] := P (1 - t/0.008);
Plot[λ[t], {t, 0, 0.008}]
SMTAddEssentialBoundary[Line[{{-3, -3}, {3, -3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{-3, 3}, {3, 3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{-3, 3}, {-3, -3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{3, -3}, {3, 3}}], 1 -> 0, 2 -> 0];
SMTAddNaturalBoundary[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, 1 -> λ[t]];
SMTAnalysis[];

SMTNextStep["Δt" -> 0.008, "λ[t]" -> λ];
While[
  While[
    step=SMTConvergence[10^-8,15, {"Adaptive Time", 8, .00001, 0.01, 10}], 
    SMTNewtonIteration[];
];
If[
  step[[4]] === "MinBound",
  SMTStatusReport["Analyze"]; 
  SMTStepBack[];
];
step[[3]],
If[
  step[[1]],
  SMTStepBack[];
];
SMTNextStep["Δt" -> step[[2]],"λ[t]" -> λ]];

Show[
  SMTShowMesh["BoundaryConditions" -> True, "Field" -> "Sxx","Contour" ->True]
 ]
$\endgroup$
4
  • $\begingroup$ Do you get any specific errors? $\endgroup$
    – Sektor
    Jun 3, 2017 at 10:29
  • $\begingroup$ I am getting this error Error in natural boundary condition. Description : Bondary condition is not of the prescribed form. Problematic natural boundary condition: {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, 1 -> 1000000*(1 - 125.*t)} Node:1 Value:\{1.*10^6 (1. -125. t)} Version: 6.816 Windows (10 May 17) (MMA 11 See also: Input Data AceFEM Troubleshooting Continue for this particular code [Lambda][t_] := P (1 - t/0.008); Plot[[Lambda][t], {t, 0, 0.008}] SMTAddNaturalBoundary[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, 1 -> [Lambda][t]]; $\endgroup$ Jun 4, 2017 at 16:36
  • $\begingroup$ @SwapnilAgarwal In the "Cyclic tension test" example from the manual only essential boundary conditions are specified, while the error message you posted in the comment mentions natural boundary conditions (SMTAddNaturalBoundary). Can you please edit your question to include all the code you have used and a clearly explain your goals. $\endgroup$
    – Pinti
    Jun 4, 2017 at 18:06
  • $\begingroup$ @Pinti mam, I have made the changes to question and code. $\endgroup$ Jun 5, 2017 at 6:27

1 Answer 1

4
$\begingroup$

There are multiple issues with your code, but lets first address the source of error message about "Boundary condition is not of prescribed form".

Bellow I have copied the first section of your original code, up until SMTAnalysis command. After this we can already check if our data structures have been input correctly. (All built-in symbols/functions start with capital letter, your symbols defined in notebook should start with lowercase letter, so they can be easily distinguished. Keep in mind this good practice.)

<< AceFEM`; 

(* Note: This code section has intentional errors! *)
SMTInputData[];
P = 1000000; 
SMTAddDomain["Ω","ML:SEPET1DFLET1DHooke", {"E *" -> 1000, "ν *" -> 0.3}];
SMTAddMesh[ToElementMesh[
  ImplicitRegion[x^2 + y^2 > 0.05, {x, y}],
 {{-3, 3}, {-3, 3}},"MeshOrder" -> 1], "Ω"
];
Clear[λ];
λ[t_] := P (1 - t/0.008);
Plot[λ[t], {t, 0, 0.008}]
SMTAddEssentialBoundary[Line[{{-3, -3}, {3, -3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{-3, 3}, {3, 3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{-3, 3}, {-3, -3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{3, -3}, {3, 3}}], 1 -> 0, 2 -> 0];
SMTAddNaturalBoundary[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, 1 -> λ[t]];
SMTAnalysis[];

When you evaluate this code you get the error message saying "Error in natural boundary condition". Reason for this is that syntax SMTAddNaturalBoundary[..., 1 -> λ[t]]; is wrong. See the quote from documentation:

documentation screenshot

Current value of boundary conditions (Bt) is calculated from its value in previous time/load step (Bp): Bt=Bp+Δλ dB. Multiplier increment Δλ and reference BC intensity dB can have arbitrary values, but value of their product should be meaningful. Typically dB is set to 1 and multiplier λ goes from 0 to its final value. Multiplier can be also a function of time λ[t] and then time t goes from 0 to final time.

So, changing the definition of natural BC removes the error message, but there is another problem.

SMTAddNaturalBoundary[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, 1 -> 1];

You apply the force (natural BC) to nodes with specific node numbers from 1-15, but how can you be sure upfront what are the node numbers on your mesh in some area of interest. See the picture bellow, where one node on the inner edge doesn't get the applied force, but it probably should.

wrong mesh

It is much better to find nodes of interest with appropriate "node selector", some function of their initial position. This is the whole block of code for correct definition of input phase. For NBC all nodes on the circle with the specified radius are chosen.

(* This definition of hole size is clearer. *)
holeRadius = 0.25;
SMTInputData[];
SMTAddDomain["Ω","ML:SEPET1DFLET1DHooke", {"E *" -> 1000, "ν *" -> 0.3}];
SMTAddMesh[
  ToElementMesh[
   ImplicitRegion[x^2 + y^2 > holeRadius^2, {x, y}], {{-3, 3}, {-3, 3}}, 
   "MeshOrder" -> 1],
  "Ω"];
SMTAddEssentialBoundary[Line[{{-3, -3}, {3, -3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{-3, 3}, {3, 3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{-3, 3}, {-3, -3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{3, -3}, {3, 3}}], 1 -> 0, 2 -> 0];
SMTAddNaturalBoundary[("X"^2 + "Y"^2 == holeRadius^2) &, 1 -> 1];
SMTAnalysis[];

SMTShowMesh["BoundaryConditions"->True,PlotRange->0.5,ImageSize->200]

correct mesh

Time always starts from 0 and I think BC multiplier should also start from 0, but it can change as arbitrary function of time.

Clear[λ];
maxLoad = 1000000;
maxTime = 0.008;
λ[t_] := maxLoad*(t/maxTime)
(*Plot[λ[t],{t,0,0.008}]*)

These are key parameters for SMTConvergence that guide time stepping. Analysis will finish with somewhere between 10 and 100 steps. The first step will be smaller that maximum allowed step.

Δt0 = maxTime/20;
ΔtMax = maxTime/10;
ΔtMin = maxTime/100;

I am going to write explanation for analysis loop with inline comments, because it will be more readable. Analysis loop has two While loops, the outer controls time/load stepping and the inner controls number of (Newton-Rhapson) iterations for each step.

(* Increase values of BC for the first step. 
 Size of time step is prescribed, and the load multiplier changes according to function λ. *)
SMTNextStep["Δt" -> Δt0,"λ[t]" -> λ];

While[
  (* Do iterations until SMTConvergence returns something else than explicit True. 
  In case of "Adaptive Time" this is a list of 4 elements that guide     further behaviour of analysis loop.
   Return value of SMTConvergence is assigned to symbol step. *)
  While[
   step = 
    SMTConvergence[10^-8,15, {"Adaptive Time",8, ΔtMin, ΔtMax, maxTime}], 
   SMTNewtonIteration[];
   ];
  If[
    Not[step[[1]]],
    (* All the code for collecting results goes here. 
    Code is evaluated only if no step back is needed. *)
    SMTShowMesh[
     "DeformedMesh"->False,"BoundaryConditions"->True,"Field"->"Sxx", "Contour" -> {-10^6, 10^6, 7},
    "Show" -> "Window" | {"Animation", "MyTestName", ImageSize -> 400}]
  ];
  If[
   step[[4]] === "MinBound",
   SMTStatusReport["Analyze"];
   SMTStepBack[];
   ];
  (* step[[3]] is test for outer While. This is the result of the last evaluation of SMTConvergence. 
  If it is True analysis should make another step (forward or backward). 
  It is False only if the final time has been reached or analysis has diverged. *)
  step[[3]],
  If[
   step[[1]],
   SMTStepBack[];
   ];
  (* If analysis has converged in the last step and has not yet reached the final value of time, 
  another step should be made. 
  Step size is prescribed by SMTConvergence and saved in step[[2]]. *)
  SMTNextStep["Δt" -> step[[2]],"λ[t]" -> λ]
  ];

SMTShowMesh["BoundaryConditions"->True,"Contour" -> True,"Field" -> "Sxx", "Mesh" -> Gray, ImageSize -> 300]

result

$\endgroup$
7
  • $\begingroup$ when I was going through the manual I did understand why the part where Boundary condition was showing an error that but after running the code.So i had change it as you mentioned but the response is same as static load. $\endgroup$ Jun 5, 2017 at 10:13
  • $\begingroup$ @SwapnilAgarwal The example you gave in you question is quasi-static. Inertial effects are neglected and in absence of other time dependent phenomena the response is independent of time. You can find example of implicit dynamic analysis in AceFEM documentation in "2D snooker simulation" example. If you are interested in dynamic analysis you should ask another question with very clear explanation of your goals. $\endgroup$
    – Pinti
    Jun 5, 2017 at 14:00
  • $\begingroup$ Why is there no change in stresses when i keep ` λ[t_] := maxLoad*(1-(t/maxTime))` Is there any possible way to load this kind of condition. Also is there any mistake in the way i am using this animation command. ` SMTMakeAnimation["blast", "gif","AnimationRepitions"->Infinity ]` I am getting the error of no frames have been stored under this keyword $\endgroup$ Jun 5, 2017 at 18:16
  • $\begingroup$ @SwapnilAgarwal There is no stress, because with your definition of λ[t_] the final value of BC multiplier is zero (λ[maxTime]==0), so applied forces are zero. For making animation you have to first save its frames during the analysis. Please see my edited answer. $\endgroup$
    – Pinti
    Jun 5, 2017 at 19:01
  • $\begingroup$ I can't thank you enough. Thank You $\endgroup$ Jun 5, 2017 at 19:40

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.