76 private $tP = array();
94 if(isset(
$tP[
'OuvrageLoi'])) {
95 $this->nL =
$tP[
'OuvrageLoi'];
97 if(isset(
$tP[
'SurverseLoi'])) {
98 $this->nLS =
$tP[
'SurverseLoi'];
104 if(!isset($this->tP[
'C'])) {$this->tP[
'C']=0;}
105 spip_log($this,
'hydraulic.'._LOG_DEBUG);
114 public function Set($sMaj,$rMaj) {
115 $this->tP[$sMaj] = $rMaj;
116 spip_log(
"cOuvrage->Set($sMaj,$rMaj)",
'hydraulic.'._LOG_DEBUG);
136 public function Calc($sCalc,$rInit=0.) {
137 include_spip(
'hyd_inc/dichotomie.class');
143 $this->VarCal = &$this->tP[$sCalc];
144 $oDicho =
new cDichotomie($this->oLog,$this,
'OuvrageQ');
145 return $oDicho->calculer($this->tP[
'Q'],$this->tP[
'rPrec'],$rInit);
157 if(!in_array($this->nL,array(3,5))) {
160 if($this->tP[
'ZM'] == $this->tP[
'ZV']){
164 elseif($this->tP[
'ZM']<$this->tP[
'ZV']){
167 $ZV = $this->tP[
'ZV'];
168 $this->tP[
'ZV'] = $this->tP[
'ZM'];
169 $this->tP[
'ZM'] = $ZV;
174 if((isset($this->tP[
'W']) and $this->tP[
'W'] == 0)
175 and (!isset($this->tP[
'H'])
176 or (isset($this->tP[
'H']) and ($this->tP[
'H']==0
177 or $this->tP[
'H']>$this->tP[
'ZM'])))){
185 list($rQ,$nFlag)=$this->
CalculQ($this->nL,$this->tP[
'C']);
186 if($this->nLS and isset($this->tP[
'H']) and $this->tP[
'W']+$this->tP[
'H'] < $this->tP[
'ZM']) {
189 $this->tP[
'W'] = 99999;
190 list($rQS,$nFlagS)=$this->
CalculQ($this->nLS,$this->tP[
'CS'],$W+$this->tP[
'H']);
200 $ZM = $this->tP[
'ZV'];
201 $this->tP[
'ZV'] = $this->tP[
'ZM'];
202 $this->tP[
'ZM'] = $ZM;
205 return array($rQ,$nFlag);
215 if($this->tP[
'ZM']>$this->tP[
'W']) {
216 $rQ=$rC*$this->tP[
'W']*$this->tP[
'L']*self::R2G*sqrt($this->tP[
'ZM']-$this->tP[
'W']);
220 $this->oLog->Add(_T(
'hydraulic:debit_non_calcule').
' : ' 221 ._T(
'hydraulic:surface_libre').
' '._T(
'hydraulic:avec').
' ' 222 ._T(
'hydraulic:loi_en_charge'));
226 return array($rQ,$nFlag);
236 if($this->tP[
'ZM']>$this->tP[
'W']) {
237 $rQ=$rC*$this->tP[
'W']*$this->tP[
'L']*self::R2G*sqrt($this->tP[
'ZM']-$this->tP[
'ZV']);
241 $this->oLog->Add(_T(
'hydraulic:debit_non_calcule').
' : ' 242 ._T(
'hydraulic:surface_libre').
' '._T(
'hydraulic:avec').
' ' 243 ._T(
'hydraulic:loi_en_charge'));
247 return array($rQ,$nFlag);
258 $rQ=$rC*$this->tP[
'L']*self::R2G*pow($this->tP[
'ZM']-$rZ,1.5);
259 spip_log($rQ,
'hydraulic.'._LOG_DEBUG);
270 $rQ=$rC*self::R32*$this->tP[
'L']*self::R2G*sqrt($this->tP[
'ZM']-$rZ-$this->tP[
'ZV'])*$this->tP[
'ZV'];
284 if(!isset($this->tP[
'W'])) {
286 $this->tP[
'W'] = INF;
291 $bDenoye=(
$tP[
'ZV']<=2/3*
$tP[
'ZM']);
306 return array($Q1[0]-$Q2[0],3);
309 if(
$tP[
'ZV']<=2/3*
$tP[
'ZM']+
$tP[
'W']/3) {
313 return array($Q1[0]-$Q2[0],4);
316 return $this->
VanneNoy($rC*self::R32);
321 $mu0 = 2 / 3 *
$tP[
'C'];
330 $alpha = 1 - 0.14 *
$tP[
'ZV'] /
$tP[
'W'];
331 if($alpha < 0.4) {$alpha = 0.4;}
332 if($alpha > 0.75) {$alpha = 0.75;}
334 if(
$tP[
'ZV'] <= $alpha *
$tP[
'ZM']) {
340 $x = sqrt(1 - $tP[
'ZV'] / $tP[
'ZM']);
341 $beta = -2 * $alpha + 2.6;
343 $KF = 1 - pow(1 - $x / sqrt(1 - $alfa), $beta);
346 $KF= 5 * $x * (1 - pow(1 - 0.2 / sqrt(1 - $alfa), $beta));
351 $Q = $muf * $tP[
'L'] * self::R2G * pow($tP[
'ZM'],1.5);
361 $mu = $mu0 - 0.08 / ($tP[
'ZM'] / $tP[
'W']);
362 $mu1 = $mu0 - 0.08 / ($tP[
'ZM'] / $tP[
'W'] - 1);
364 $Q = $tP[
'L'] * self::R2G * ($mu * pow($tP[
'ZM'],1.5) - $mu1 * pow($tP[
'ZM'] - $tP[
'W'],1.5));
368 $alfa1 = 1 - 0.14 * ($tP[
'ZV'] - $tP[
'W']) / $tP[
'W'];
369 if ($alfa1<0.4) {$alfa1 = 0.4;}
370 if ($alfa1>0.75) {$alfa1 = 0.75;}
371 if($tP[
'ZV'] <= $alfa1 * $tP[
'ZM'] + (1 - $alfa1) * $tP[
'W']) {
373 $Q = $tP[
'L'] * self::R2G * ($KF * $mu * pow($tP[
'ZM'],1.5) - $mu1 * pow($tP[
'ZM'] - $tP[
'W'],1.5));
377 $x1 = sqrt(1 - ($tP[
'ZV'] - $tP[
'W']) / ($tP[
'ZM'] - $tP[
'W']));
378 $beta1 = -2 * $alfa1 + 2.6;
380 $KF1 = 1 - pow(1 - $x1 / sqrt(1 - $alfa1), $beta1);
383 $KF1 = 5* $x1 * (1 - pow(1 - 0.2 / sqrt(1 - $alfa1), $beta1));
385 $Q = $tP[
'L'] * self::R2G * ($KF * $mu * pow($tP[
'ZM'],1.5) - $KF1 * $mu1 * pow($tP[
'ZM'] - $tP[
'W'],1.5));
OuvrageQ()
Calcul du débit à l'ouvrage.
Calc($sCalc, $rInit=0.)
Calcul à l'ouvrage.
VanneDen($rC)
Loi de vanne de fond dénoyée classique.
VanneNoy($rC)
Loi de vanne de fond totalement noyée classique.
__construct(&$oLog, $tP)
3*sqrt(3)/2;
const R2G
Constante de gravité terrestre.
SeuilDen($rC, $rZ=0)
Loi seuil dénoyé classique.
Set($sMaj, $rMaj)
Mise à jour d'un paramètre de l'ouvrage.
SeuilNoy($rC, $rZ=0)
Loi seuil noyé classique.
$tP
Tableau contenant les paramètres de l'ouvrage.
CalculQ($nLoi, $rC, $rZ=0)
Calcul du débit à partir d'une loi.
$VarCal
Pointeur vers l'élément du tableau tP qui sera calculé
$nLS
Loi de débit pour la surverse.
const R32
sqrt(2*self::gP);