#include <stdlib.h>
#include <basic.h>
#include <mathfunctions.h>
#include <arrayfunctions.h>
#include <physicalmodels/fppowersystem1bus.h>
#include <mpivars.h>
#include <hypar.h>
Go to the source code of this file.
◆ FPPowerSystem1BusDissipationFunction()
double FPPowerSystem1BusDissipationFunction |
( |
int |
, |
|
|
int |
, |
|
|
void * |
, |
|
|
double |
|
|
) |
| |
Definition at line 19 of file FPPowerSystem1BusFunctions.c.
23 double sigma = params->
sigma;
24 double omegaS = params->
omegaS;
25 double omegaB = params->
omegaB;
26 double lambda = params->
lambda;
33 double term = (sigma*sigma*omegaS*omegaS) / (4.0*H*H);
34 double expterm = exp(-t/lambda);
37 dissp = term * (lambda*omegaB) * (lambda*(1-expterm) - t*expterm);
39 }
else if (dir2 ==
_YDIR_) {
40 double gamma = D*omegaS / (2.0*H);
41 dissp = term * (lambda*(1-expterm) + (gamma*lambda*(t*expterm-lambda*(1-expterm))) );
◆ FPPowerSystem1BusComputeDiffNumber()
double FPPowerSystem1BusComputeDiffNumber |
( |
void * |
s, |
|
|
void * |
m, |
|
|
double |
dt, |
|
|
double |
t |
|
) |
| |
Definition at line 11 of file FPPowerSystem1BusComputeDiffNumber.c.
16 int ndims = solver->
ndims;
17 int ghosts = solver->
ghosts;
29 double local_diff_yx =
absolute(dissp_yx) * dt * dyinv * dxinv;
30 double local_diff_yy =
absolute(dissp_yy) * dt * dyinv * dyinv;
32 if (local_diff_yx > max_diff) max_diff = local_diff_yx;
33 if (local_diff_yy > max_diff) max_diff = local_diff_yy;
double FPPowerSystem1BusDissipationFunction(int, int, void *, double)
Structure containing all solver-specific variables and functions.
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
#define _GetCoordinate_(dir, i, dim, ghosts, x, coord)