HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Function to initialize the 3-bus power system model. More...
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <basic.h>
#include <arrayfunctions.h>
#include <physicalmodels/fppowersystem3bus.h>
#include <mpivars.h>
#include <hypar.h>
Go to the source code of this file.
Functions | |
double | FPPowerSystem3BusComputeCFL (void *, void *, double, double) |
double | FPPowerSystem3BusComputeDiffNumber (void *, void *, double, double) |
int | FPPowerSystem3BusAdvection (double *, double *, int, void *, double) |
int | FPPowerSystem3BusDiffusion (double *, double *, int, int, void *, double) |
int | FPPowerSystem3BusUpwind (double *, double *, double *, double *, double *, double *, int, void *, double) |
int | FPPowerSystem3BusInitialize (void *s, void *m) |
Function to initialize the 3-bus power system model.
Definition in file FPPowerSystem3BusInitialize.c.
double FPPowerSystem3BusComputeCFL | ( | void * | s, |
void * | m, | ||
double | dt, | ||
double | t | ||
) |
Computes the maximum CFL number over the domain. Note that the CFL is computed over the local domain on this processor only.
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
dt | Time step size for which to compute the CFL |
t | Time |
Definition at line 19 of file FPPowerSystem3BusComputeCFL.c.
double FPPowerSystem3BusComputeDiffNumber | ( | void * | s, |
void * | m, | ||
double | dt, | ||
double | t | ||
) |
Computes the maximum diffusion number over the domain. Note that the diffusion is computed over the local domain on this processor only.
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
dt | Time step size for which to compute the CFL |
t | Time |
Definition at line 19 of file FPPowerSystem3BusComputeDiffNumber.c.
int FPPowerSystem3BusAdvection | ( | double * | f, |
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Compute the advection term for the FPPowerSystem3Bus system: Since the advection coefficient is a function of x and not the solution, here the flux is set to the solution. The advection velocity is multiplied during upwinding FPPowerSystem3BusUpwind().
f | Array to hold the computed flux vector (same layout as u) |
u | Array with the solution vector |
dir | Spatial dimension for which to compute the flux |
s | Solver object of type HyPar |
t | Current simulation time |
Definition at line 16 of file FPPowerSystem3BusAdvection.c.
int FPPowerSystem3BusDiffusion | ( | double * | f, |
double * | u, | ||
int | dir1, | ||
int | dir2, | ||
void * | s, | ||
double | t | ||
) |
Compute the dissipation term for the FPPowerSystem3Bus system
f | Array to hold the computed dissipation term vector (same layout as u) |
u | Array with the solution vector |
dir1 | First spatial dimension for the dissipation term being computed |
dir2 | Second spatial dimension for the dissipation term being computed |
s | Solver object of type HyPar |
t | Current simulation time |
Definition at line 15 of file FPPowerSystem3BusDiffusion.c.
int FPPowerSystem3BusUpwind | ( | double * | fI, |
double * | fL, | ||
double * | fR, | ||
double * | uL, | ||
double * | uR, | ||
double * | u, | ||
int | dir, | ||
void * | s, | ||
double | t | ||
) |
Compute the upwind flux at the interface, based on the drift velocity at that interface, from the left and right biased approximations to the interface flux. The drift (advection) velocity is multiplied to the solution in this function to get the advective flux.
fI | Computed upwind interface flux |
fL | Left-biased reconstructed interface flux |
fR | Right-biased reconstructed interface flux |
uL | Left-biased reconstructed interface solution |
uR | Right-biased reconstructed interface solution |
u | Cell-centered solution |
dir | Spatial dimension (x or y) |
s | Solver object of type HyPar |
t | Current solution time |
Definition at line 18 of file FPPowerSystem3BusUpwind.c.
int FPPowerSystem3BusInitialize | ( | void * | s, |
void * | m | ||
) |
Initialize the 3-bus power system model: Sets the default parameters, read in and set physics-related parameters, and set the physics-related function pointers in HyPar.
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
Definition at line 27 of file FPPowerSystem3BusInitialize.c.