Add utilities for computing derived fluid quantities.
These are (currently) entirely geared towards pressure solvers.
This commit is contained in:
parent
a886165290
commit
b193e461ca
32
Makefile.am
32
Makefile.am
@ -12,6 +12,7 @@ libopmpressure_HEADERS = \
|
|||||||
blas_lapack.h \
|
blas_lapack.h \
|
||||||
coarse_conn.h \
|
coarse_conn.h \
|
||||||
coarse_sys.h \
|
coarse_sys.h \
|
||||||
|
compr_quant.h \
|
||||||
dfs.h \
|
dfs.h \
|
||||||
flow_bc.h \
|
flow_bc.h \
|
||||||
fsh.h \
|
fsh.h \
|
||||||
@ -30,21 +31,22 @@ GridAdapter.hpp \
|
|||||||
HybridPressureSolver.hpp
|
HybridPressureSolver.hpp
|
||||||
|
|
||||||
|
|
||||||
libopmpressure_la_SOURCES = \
|
libopmpressure_la_SOURCES = \
|
||||||
coarse_conn.c \
|
coarse_conn.c \
|
||||||
coarse_sys.c \
|
coarse_sys.c \
|
||||||
dfs.c \
|
compr_quant.c \
|
||||||
flow_bc.c \
|
dfs.c \
|
||||||
fsh.c \
|
flow_bc.c \
|
||||||
fsh_common.c \
|
fsh.c \
|
||||||
hash_set.c \
|
fsh_common.c \
|
||||||
hybsys.c \
|
hash_set.c \
|
||||||
hybsys_global.c \
|
hybsys.c \
|
||||||
ifsh.c \
|
hybsys_global.c \
|
||||||
ifsh_ms.c \
|
ifsh.c \
|
||||||
mimetic.c \
|
ifsh_ms.c \
|
||||||
partition.c \
|
mimetic.c \
|
||||||
sparse_sys.c \
|
partition.c \
|
||||||
|
sparse_sys.c \
|
||||||
well.c
|
well.c
|
||||||
|
|
||||||
|
|
||||||
|
81
compr_quant.c
Normal file
81
compr_quant.c
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||||
|
|
||||||
|
This file is part of the Open Porous Media project (OPM).
|
||||||
|
|
||||||
|
OPM is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OPM is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "compr_quant.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
/* Compute B \ (V') == zeta(cellNo) .* faceFlux2CellFlux(fflux) */
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
void
|
||||||
|
compr_flux_term(grid_t *G,
|
||||||
|
const double *fflux,
|
||||||
|
const double *zeta,
|
||||||
|
double *Biv)
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
{
|
||||||
|
int c, i, f;
|
||||||
|
double s;
|
||||||
|
|
||||||
|
for (c = i = 0; c < G->number_of_cells; c++) {
|
||||||
|
for (; i < G->cell_facepos[c + 1]; i++) {
|
||||||
|
f = G->cell_faces[i];
|
||||||
|
s = 2.0*(c == G->face_cells[2*f + 0]) - 1.0;
|
||||||
|
|
||||||
|
Biv[i] = zeta[c] * s * fflux[f];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
/* Compute P == ct .* pv ./ dt */
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
void
|
||||||
|
compr_accum_term(size_t nc,
|
||||||
|
double dt,
|
||||||
|
const double *porevol,
|
||||||
|
const double *totcompr,
|
||||||
|
double *P)
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
{
|
||||||
|
size_t c;
|
||||||
|
|
||||||
|
for (c = 0; c < nc; c++) {
|
||||||
|
P[c] = totcompr[c] * porevol[c] / dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
/* Add pressure accumulation term (P*p_0) to cell sources */
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
void
|
||||||
|
compr_src_add_press_accum(size_t nc,
|
||||||
|
const double *p0,
|
||||||
|
const double *P,
|
||||||
|
double *src)
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
{
|
||||||
|
size_t c;
|
||||||
|
|
||||||
|
for (c = 0; c < nc; c++) {
|
||||||
|
src[c] += P[c] * p0[c];
|
||||||
|
}
|
||||||
|
}
|
46
compr_quant.h
Normal file
46
compr_quant.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||||
|
|
||||||
|
This file is part of the Open Porous Media project (OPM).
|
||||||
|
|
||||||
|
OPM is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OPM is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef OPM_COMPR_QUANT_HEADER_INCLUDED
|
||||||
|
#define OPM_COMPR_QUANT_HEADER_INCLUDED
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include "grid.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
compr_flux_term(grid_t *G,
|
||||||
|
const double *fflux,
|
||||||
|
const double *zeta,
|
||||||
|
double *Biv);
|
||||||
|
|
||||||
|
void
|
||||||
|
compr_accum_term(size_t nc,
|
||||||
|
double dt,
|
||||||
|
const double *porevol,
|
||||||
|
const double *totcompr,
|
||||||
|
double *P);
|
||||||
|
|
||||||
|
void
|
||||||
|
compr_src_add_press_accum(size_t nc,
|
||||||
|
const double *p0,
|
||||||
|
const double *P,
|
||||||
|
double *src);
|
||||||
|
|
||||||
|
#endif /* OPM_COMPR_QUANT_HEADER_INCLUDED */
|
Loading…
Reference in New Issue
Block a user