BELFEM
0.9.3
Berkeley Lab Finite Element Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
ramps.hpp
Go to the documentation of this file.
1
/*
2
* BELFEM -- The Berkeley Lab Finite Element Framework
3
* Copyright (c) 2026, The Regents of the University of California,
4
* through Lawrence Berkeley National Laboratory (subject to receipt of any required
5
* approvals from the U.S. Dept. of Energy). All rights reserved.
6
*
7
* Developers: Christian Messe, Gregory Giard
8
*
9
* See the top-level LICENSE file for the complete license and disclaimer.
10
*/
11
12
/*
13
* The time programme of the tapestack3d quench run, in ONE place: the
14
* transport current and the Ic defect are both driven from here, so the two
15
* cannot drift apart between the deck and the plugin.
16
*
17
* Story of the run: a linear current ramp, as in an Ic test. Three seconds
18
* in, the topmost tape loses 90 % of its jc over a 1.5 mm disk; the solder
19
* diverts that tape's share into the seven healthy tapes, which have ample
20
* margin at that current. The ramp does not stop, so the stack runs out of
21
* margin a few seconds later and quenches, starting at the defect where the
22
* diverted current crosses the resistive solder.
23
*
24
* The defect switch is the logistic the deck's `type : sigmoid` source uses
25
* ( cl_SourceFunction.hpp, function_sigmoid ):
26
*
27
* s( t ) = 1 / ( 1 + exp( beta * ( d - t ) ) ),
28
* d = offset + period / 2,
29
* beta = -2 ln( fuzzyness / ( 1 - fuzzyness ) ) / period,
30
*
31
* so s( offset ) = fuzzyness and s( offset + period ) = 1 - fuzzyness.
32
* Included by defect.cpp and current.cpp; both compile into userdefect.so.
33
*/
34
35
#ifndef TAPESTACK3D_RAMPS_HPP
36
#define TAPESTACK3D_RAMPS_HPP
37
38
#include <algorithm>
39
#include <cmath>
40
41
namespace
ramps
42
{
43
// ---- transport current ( boundary condition MyCurrent ) ----------------
44
// Linear ramp of the TOTAL stack current ( eight tapes in parallel ).
45
// 200 A/s reaches 2000 A at the 10 s end of the run, above the stack's
46
// self-field Ic at 77 K, so the quench happens DURING the ramp rather
47
// than depending on a plateau value guessed right. sp-ap at 77.5 K,
48
// self-field: 380 A/cm, i.e. 152 A per 4 mm tape with the table's 1 um
49
// layer convention, 243 A with the deck's 1.6 um ybco layer.
50
constexpr
double
gCurrentRate
= 200.0 ;
// A/s
51
constexpr
double
gCurrentMax
= 2500.0 ;
// A, safety cap, not reached in 10 s
52
53
// ---- Ic defect switch-on ( MyDefect ) -----------------------------------
54
// Fully on at 3.5 s, when the stack carries 700 A ( ~88 A per tape ).
55
// The top tape sheds ~80 A into its neighbours, which then sit near
56
// 45 % of Ic: the defect alone must NOT quench the stack, the ramp does.
57
constexpr
double
gDefectOffset
= 3.0 ;
// s
58
constexpr
double
gDefectPeriod
= 0.5 ;
// s
59
constexpr
double
gDefectFuzzyness
= 1.0e-3 ;
60
61
inline
double
62
sigmoid
(
const
double
t,
const
double
aOffset,
const
double
aPeriod,
const
double
aFuzzyness )
63
{
64
const
double
d = aOffset + 0.5 * aPeriod ;
65
const
double
beta = -2.0 * std::log( aFuzzyness / ( 1.0 - aFuzzyness ) ) / aPeriod ;
66
return
1.0 / ( 1.0 + std::exp( beta * ( d - t ) ) );
67
}
68
69
inline
double
70
current
(
const
double
t )
71
{
72
return
std::min(
gCurrentRate
* std::max( t, 0.0 ),
gCurrentMax
);
73
}
74
75
inline
double
76
defect_switch
(
const
double
t )
77
{
78
return
sigmoid
( t,
gDefectOffset
,
gDefectPeriod
,
gDefectFuzzyness
);
79
}
80
}
81
82
#endif
// TAPESTACK3D_RAMPS_HPP
ramps
Definition
ramps.hpp:42
ramps::gDefectFuzzyness
constexpr double gDefectFuzzyness
Definition
ramps.hpp:59
ramps::defect_switch
double defect_switch(const double t)
Definition
ramps.hpp:76
ramps::gCurrentMax
constexpr double gCurrentMax
Definition
ramps.hpp:51
ramps::gDefectOffset
constexpr double gDefectOffset
Definition
ramps.hpp:57
ramps::sigmoid
double sigmoid(const double t, const double aOffset, const double aPeriod, const double aFuzzyness)
Definition
ramps.hpp:62
ramps::gCurrentRate
constexpr double gCurrentRate
Definition
ramps.hpp:50
ramps::gDefectPeriod
constexpr double gDefectPeriod
Definition
ramps.hpp:58
ramps::current
double current(const double t)
Definition
ramps.hpp:70
examples
tapestack3d_quench
src
ramps.hpp
Generated by
1.18.0