HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FPPowerSystemFunctions.c File Reference
#include <math.h>
#include <physicalmodels/fppowersystem.h>

Go to the source code of this file.

Functions

double FPPowerSystemDriftFunction (int dir, void *p, double x, double y, double t)
 
double FPPowerSystemDissipationFunction (int dir, void *p, double t)
 

Function Documentation

double FPPowerSystemDriftFunction ( int  dir,
void *  p,
double  x,
double  y,
double  t 
)

Definition at line 4 of file FPPowerSystemFunctions.c.

5 {
6  FPPowerSystem *params = (FPPowerSystem*) p;
7 
8  double drift = 0;
9  if (dir == 0) drift = params->O_s * (y - 1.0);
10  else if (dir == 1) {
11  if (t < params->tf) params->Pmax = params->E*params->V/params->g1;
12  else if (t < params->tcl) params->Pmax = 0.0;
13  else params->Pmax = params->E*params->V/params->g2;
14  drift = (1.0/(2.0*params->H)) * (params->Pm - params->Pmax*sin(x) - params->D*(y-1.0));
15  }
16 
17  return drift;
18 }
#define drift(x)
Definition: fpdoublewell.h:31
double FPPowerSystemDissipationFunction ( int  dir,
void *  p,
double  t 
)

Definition at line 20 of file FPPowerSystemFunctions.c.

21 {
22  FPPowerSystem *params = (FPPowerSystem*) p;
23 
24  double dissp = 0;
25  if (dir == 1) {
26  double gamma = params->D / (2.0*params->H);
27  dissp = (1.0/(2.0*params->H)) * (1.0/(2.0*params->H))
28  * ((params->l*params->q*params->q)/(params->l*gamma+1.0))
29  * (1.0 - exp(-(gamma+1.0/params->l)*t));
30  }
31 
32  return(dissp);
33 }