Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
tutorials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
documentation
tutorials
Commits
5fff6561
Commit
5fff6561
authored
2 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
small enhancements (cf.
#17
)
parent
070d2b1e
No related branches found
No related tags found
No related merge requests found
Pipeline
#9785
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Magnetodynamics/electromagnet.pro
+28
-12
28 additions, 12 deletions
Magnetodynamics/electromagnet.pro
with
28 additions
and
12 deletions
Magnetodynamics/electromagnet.pro
+
28
−
12
View file @
5fff6561
...
...
@@ -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
}
];
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment