17 double*,
double*,
int,
void*,
double);
32 fprintf(stderr,
"Error in FPPowerSystem1BusInitialize(): nvars has to be %d.\n",
_MODEL_NVARS_);
36 fprintf(stderr,
"Error in FPPowerSystem1BusInitialize(): ndims has to be %d.\n",
_MODEL_NDIMS_);
42 physics->
omegaB = 120 * (4.0 * atan(1.0));
53 if (!count) printf(
"Reading physical model inputs from file \"physics.inp\".\n");
54 in = fopen(
"physics.inp",
"r");
55 if (!in) printf(
"Warning: File \"physics.inp\" not found. Using default values.\n");
58 ferr = fscanf(in,
"%s",word);
if (ferr != 1)
return(1);
59 if (!strcmp(word,
"begin")){
60 while (strcmp(word,
"end")){
61 ferr = fscanf(in,
"%s",word);
if (ferr != 1)
return(1);
62 if (!strcmp(word,
"omegaS")) {ferr=fscanf(in,
"%lf",&physics->
omegaS);
if(ferr!=1)
return(1);}
63 else if (!strcmp(word,
"omegaB")) {ferr=fscanf(in,
"%lf",&physics->
omegaB);
if(ferr!=1)
return(1);}
64 else if (!strcmp(word,
"H" )) {ferr=fscanf(in,
"%lf",&physics->
H );
if(ferr!=1)
return(1);}
65 else if (!strcmp(word,
"D" )) {ferr=fscanf(in,
"%lf",&physics->
D );
if(ferr!=1)
return(1);}
66 else if (!strcmp(word,
"Pm_avg")) {ferr=fscanf(in,
"%lf",&physics->
Pm_avg);
if(ferr!=1)
return(1);}
67 else if (!strcmp(word,
"Pmax" )) {ferr=fscanf(in,
"%lf",&physics->
Pmax );
if(ferr!=1)
return(1);}
68 else if (!strcmp(word,
"sigma" )) {ferr=fscanf(in,
"%lf",&physics->
sigma );
if(ferr!=1)
return(1);}
69 else if (!strcmp(word,
"lambda")) {ferr=fscanf(in,
"%lf",&physics->
lambda);
if(ferr!=1)
return(1);}
72 fprintf(stderr,
"Error: Illegal format in file \"physics.inp\".\n");
92 fprintf(stderr,
"Error in FPPowerSystem1BusInitialize: This physical model does not have a splitting ");
93 fprintf(stderr,
"of the hyperbolic term defined.\n");
double FPPowerSystem1BusComputeDiffNumber(void *s, void *m, double dt, double t)
double(* ComputeCFL)(void *, void *, double, double)
int MPIBroadcast_double(double *, int, int, void *)
int(* HFunction)(double *, double *, int, int, void *, double)
int FPPowerSystem1BusPrintStep(void *, void *, double)
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
MPI related function definitions.
int FPPowerSystem1BusPostStep(double *, void *, void *, double, int)
int(* FFunction)(double *, double *, int, void *, double)
double FPPowerSystem1BusComputeCFL(void *s, void *m, double dt, double t)
#define _MAX_STRING_SIZE_
double(* ComputeDiffNumber)(void *, void *, double, double)
int FPPowerSystem1BusDiffusionGeneral(double *f, double *u, int dir1, int dir2, void *s, double t)
int FPPowerSystem1BusDiffusionLaplacian(double *f, double *u, int dir, void *s, double t)
int FPPowerSystem1BusInitialize(void *, void *)
Contains structure definition for hypar.
char SplitHyperbolicFlux[_MAX_STRING_SIZE_]
Some basic definitions and macros.
int(* PrintStep)(void *, void *, double)
Contains macros and function definitions for common array operations.
int FPPowerSystem1BusUpwind(double *, double *, double *, double *, double *, double *, int, void *, double)
Structure of MPI-related variables.
Structure containing all solver-specific variables and functions.
Fokker-Planck Model for 1-Bus Power System.
int FPPowerSystem1BusAdvection(double *f, double *u, int dir, void *s, double t)
int(* GFunction)(double *, double *, int, void *, double)
int(* PostStep)(double *, void *, void *, double, int)