Skip to content
Snippets Groups Projects
Commit 5fff6561 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

small enhancements (cf. #17)

parent 070d2b1e
No related branches found
No related tags found
No related merge requests found
Pipeline #9785 passed
......@@ -54,26 +54,33 @@ Group {
Function {
DefineConstant[
Current = {0.01, Name "Model parameters/Current"},
frequency = {50, Visible !TimeDomain,
Name "Model parameters/Frequency" }
Current = {0.01, Name "Model parameters/Max. current [A]"},
murCore = {100, Visible !NonLinearCore,
Name "Model parameters/Mur core"}
// by default, a linear ramp from 0 to 1 until 10 ms, then a constant value
// of 1; any desired function can be specified
timeFunction = {"($Time < TimeFinal / 2) ? (2 / TimeFinal * $Time) : 1",
Choices{"($Time < TimeFinal / 2) ? (2 / TimeFinal * $Time) : 1",
"Sin[2*Pi*frequency*$Time]", "Sin[2*Pi*10*$Time]"},
Name "Model parameters/04Time function", Visible TimeDomain}
// overwrite parameters from the "Lib_Magnetodynamics2D_av_Cir.pro"
// template:
Freq = {50, Visible !TimeDomain,
Name "Model parameters/04Frequency [Hz]" }
DeltaTime = {1e-3,
Name "Model parameters/05Time step [s]", Visible TimeDomain}
TimeFinal = {20e-3,
Name "Model parameters/06Final simulation time [s]", Visible TimeDomain}
];
If(TimeDomain)
Parse[StrCat["myModulation[] = ", timeFunction, ";"]];
// Fix parameters from the "Lib_Magnetodynamics2D_av_Cir.pro" template:
If(TimeDomain)
Flag_FrequencyDomain = 0;
TimeInit = 0; // start simulation at time = 0s
TimeFinal = 20e-3; // stop simulation at time = 20 ms
DeltaTime = 1e-3; // use time steps equal to 1 ms
// Define the time modulation of the current source, i.e. a linear ramp from
// 0 to 1 until 10 ms, then a constant value of 1:
myModulation[] = ($Time < TimeFinal / 2) ? (2 / TimeFinal * $Time) : 1;
Else
// Fix parameters from the "Lib_Magnetodynamics2D_av_Cir.pro" template:
Flag_FrequencyDomain = 1;
Freq = frequency;
EndIf
mu0 = 4.e-7 * Pi;
......@@ -156,6 +163,8 @@ PostOperation {
Print[ az, OnElementsOf Vol_Mag, File "az.pos" ];
Print[ b, OnElementsOf Vol_Mag, File "b.pos" ];
Print[ j, OnElementsOf Vol_Mag, File "j.pos" ];
Print[ I, OnRegion Ind, File "I.txt", Format TimeTable,
SendToServer "Output/Imposed current" ];
}
}
{ Name sta; NameOfPostProcessing Magnetostatics2D_a;
......@@ -166,3 +175,10 @@ PostOperation {
}
}
}
// Choose resolution, computation and post-operation in interactive mode
DefineConstant [
R_ = {"Magnetodynamics2D_av", Name "GetDP/1ResolutionChoices", Visible 0},
C_ = {"-solve -pos -bin", Name "GetDP/9ComputeCommand", Visible 0},
P_ = {"dyn", Name "GetDP/2PostOperationChoices", Visible 0}
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment