Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jalhyd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
Cassiopée
jalhyd
Commits
96b4c64e
Commit
96b4c64e
authored
2 years ago
by
François Grand
Browse files
Options
Downloads
Patches
Plain Diff
Session: add pressure loss nub creation
refs
#334
parent
be882e93
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/pipe_flow/pl_lechaptcalmon_params.ts
+2
-3
2 additions, 3 deletions
src/pipe_flow/pl_lechaptcalmon_params.ts
src/pipe_flow/pressureloss.ts
+14
-3
14 additions, 3 deletions
src/pipe_flow/pressureloss.ts
src/session.ts
+34
-15
34 additions, 15 deletions
src/session.ts
with
50 additions
and
21 deletions
src/pipe_flow/pl_lechaptcalmon_params.ts
+
2
−
3
View file @
96b4c64e
import
{
ParamDefinition
,
ParamFamily
}
from
"
../param/param-definition
"
;
import
{
ParamDefinition
}
from
"
../param/param-definition
"
;
import
{
ParamDomain
,
ParamDomainValue
}
from
"
../param/param-domain
"
;
import
{
PressureLossParams
}
from
"
./pressureloss_params
"
;
...
...
@@ -16,8 +16,7 @@ export class PL_LechaptCalmonParams extends PressureLossParams {
/** Paramètre de rugosité N */
private
_N
:
ParamDefinition
;
constructor
(
rQ
:
number
,
rD
:
number
,
rJ
:
number
,
rLg
:
number
,
rL
:
number
,
rM
:
number
,
rN
:
number
,
rKs
:
number
,
nullParams
:
boolean
=
false
)
{
constructor
(
rQ
:
number
,
rD
:
number
,
rJ
:
number
,
rLg
:
number
,
rKs
:
number
,
rL
:
number
,
rM
:
number
,
rN
:
number
,
nullParams
:
boolean
=
false
)
{
super
(
rQ
,
rD
,
rJ
,
rLg
,
rKs
,
nullParams
);
this
.
_L
=
new
ParamDefinition
(
this
,
"
L
"
,
new
ParamDomain
(
ParamDomainValue
.
INTERVAL
,
0.8
,
2
),
undefined
,
rL
,
undefined
,
false
,
nullParams
);
...
...
This diff is collapsed.
Click to expand it.
src/pipe_flow/pressureloss.ts
+
14
−
3
View file @
96b4c64e
...
...
@@ -3,12 +3,23 @@ import { Observer } from "../util/observer";
import
{
Result
}
from
"
../util/result
"
;
import
{
CalculatorType
}
from
"
../compute-node
"
;
import
{
PressureLossParams
}
from
"
./pressureloss_params
"
;
import
{
PressureLossLaw
}
from
"
../pipe_flow/pressureloss_law
"
;
import
{
ParamCalculability
}
from
"
../param/param-definition
"
;
import
{
Message
,
MessageCode
}
from
"
../util/message
"
;
export
class
PressureLoss
extends
Nub
implements
Observer
{
constructor
(
prms
:
PressureLoss
Params
,
dbg
:
boolean
=
false
)
{
super
(
prms
,
dbg
);
constructor
(
law
:
PressureLoss
Law
,
dbg
:
boolean
=
false
)
{
super
(
undefined
,
dbg
);
this
.
setCalculatorType
(
CalculatorType
.
PressureLoss
);
this
.
addChild
(
law
);
}
/**
* paramètres castés au bon type
*/
get
prms
():
PressureLossParams
{
return
this
.
_prms
as
PressureLossParams
;
}
/**
...
...
@@ -18,7 +29,7 @@ export class PressureLoss extends Nub implements Observer {
}
public
Equation
(
sVarCalc
:
string
):
Result
{
return
undefined
;
return
this
.
_children
[
0
].
Equation
(
sVarCalc
)
;
}
// interface Observer
...
...
This diff is collapsed.
Click to expand it.
src/session.ts
+
34
−
15
View file @
96b4c64e
...
...
@@ -87,6 +87,9 @@ import { PbCloison } from "./prebarrage/pb_cloison";
import
{
PbBassin
}
from
"
./prebarrage/pb_bassin
"
;
import
{
PbBassinParams
}
from
"
./prebarrage/pb_bassin_params
"
;
import
{
ParamValueMode
}
from
"
./param/param-value-mode
"
;
import
{
PressureLoss
}
from
"
./pipe_flow/pressureloss
"
;
import
{
PressureLossParams
}
from
"
./pipe_flow/pressureloss_params
"
;
import
{
PressureLossLaw
,
PressureLossType
}
from
"
./pipe_flow/pressureloss_law
"
;
export
class
Session
{
...
...
@@ -393,21 +396,6 @@ export class Session {
nub
=
new
ConduiteDistrib
(
prms
,
dbg
);
break
;
case
CalculatorType
.
LechaptCalmon
:
prms
=
new
PL_LechaptCalmonParams
(
3
,
// débit
1.2
,
// diamètre
0.6
,
/// perte de charge
100
,
// longueur du toyo
1.863
,
// paramètre L du matériau
2
,
// paramètre M du matériau
5.33
,
// paramètre N du matériau
0
,
// Ks Perte de charge singulière
nullParams
);
nub
=
new
PL_LechaptCalmon
(
prms
,
dbg
);
break
;
case
CalculatorType
.
SectionParametree
:
nub
=
new
SectionParametree
(
undefined
,
dbg
);
break
;
...
...
@@ -800,6 +788,12 @@ export class Session {
nub
=
new
PbCloison
(
undefined
,
undefined
,
undefined
,
nullParams
);
break
;
case
CalculatorType
.
PressureLoss
:
const
lossType
:
PressureLossType
=
params
.
getPropValue
(
"
pressureLossType
"
);
const
pl
=
this
.
createPressureLossLaw
(
lossType
,
dbg
,
nullParams
);
nub
=
new
PressureLoss
(
pl
,
dbg
);
break
;
default
:
throw
new
Error
(
`Session.createNub() : type de module '
${
CalculatorType
[
calcType
]}
' non pris en charge`
...
...
@@ -991,6 +985,31 @@ export class Session {
}
}
/**
* Crée un Nub de type perte de charge
*/
private
createPressureLossLaw
(
plt
:
PressureLossType
,
dbg
:
boolean
=
false
,
nullParams
:
boolean
=
false
):
PressureLossLaw
{
switch
(
plt
)
{
case
PressureLossType
.
LechaptCalmon
:
const
prms
=
new
PL_LechaptCalmonParams
(
3
,
// débit
1.2
,
// diamètre
0.6
,
/// perte de charge
100
,
// longueur du toyo
0
,
// Ks Perte de charge singulière
1.863
,
// paramètre L du matériau
2
,
// paramètre M du matériau
5.33
,
// paramètre N du matériau
nullParams
);
return
new
PL_LechaptCalmon
(
prms
,
dbg
);
default
:
throw
new
Error
(
`type de perte de charge
${
PressureLossType
[
plt
]}
non pris en charge`
);
}
}
/**
* Creates a Nub from an object representation and adds it to the current session; returns
* a pointer to the Nub and its JSON metadata
...
...
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