Skip to content

Commit

Permalink
Moving dyn poro terms to LHS
Browse files Browse the repository at this point in the history
  • Loading branch information
rwalkerlewis committed Jun 17, 2023
1 parent 3fcdab9 commit a3b8b47
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 42 deletions.
117 changes: 83 additions & 34 deletions libsrc/pylith/fekernels/IsotropicLinearPoroelasticity.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1850,11 +1850,16 @@ public:

// Solution Variables
const PylithScalar trace_strain_t = poroelasticContext.trace_strain_t;
const PylithScalar pressure_t = poroelasticContext.pressure_t;

// Rheology Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
const PylithScalar biotModulus = rheologyContext.biotModulus;

g0[0] -= biotCoefficient * trace_strain_t;
// Rheological Auxiliaries

g0[0] += pressure_t / biotModulus;
g0[0] += biotCoefficient * trace_strain_t;
} // g0p_implicit

// ----------------------------------------------------------------------
Expand Down Expand Up @@ -1897,15 +1902,20 @@ public:

// Solution Variables
const PylithScalar trace_strain_t = poroelasticContext.trace_strain_t;
const PylithScalar pressure_t = poroelasticContext.pressure_t;

// Rheology Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
const PylithScalar biotModulus = rheologyContext.biotModulus;

// Poroelastic Auxiliaries
const PylithScalar source = poroelasticContext.sourceDensity;

// Rheologic Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
// Rheological Auxiliaries
g0[0] -= source;
g0[0] += pressure_t / biotModulus;
g0[0] += biotCoefficient * trace_strain_t;

g0[0] += source;
g0[0] -= biotCoefficient * trace_strain_t;
} // g0p_source

// ----------------------------------------------------------------------
Expand Down Expand Up @@ -1948,15 +1958,19 @@ public:

// Solution Variables
const PylithScalar trace_strain_t = poroelasticContext.trace_strain_t;
const PylithScalar pressure_t = poroelasticContext.pressure_t;

// Rheology Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
const PylithScalar biotModulus = rheologyContext.biotModulus;

// Poroelastic Auxiliaries
const PylithScalar source = poroelasticContext.sourceDensity;

// Rheologic Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
g0[0] -= source;
g0[0] += pressure_t / biotModulus;
g0[0] += biotCoefficient * trace_strain_t;

g0[0] += source;
g0[0] -= biotCoefficient * trace_strain_t;
} // g0p_source_body

// ----------------------------------------------------------------------
Expand Down Expand Up @@ -1999,15 +2013,19 @@ public:

// Solution Variables
const PylithScalar trace_strain_t = poroelasticContext.trace_strain_t;
const PylithScalar pressure_t = poroelasticContext.pressure_t;

// Rheology Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
const PylithScalar biotModulus = rheologyContext.biotModulus;

// Poroelastic Auxiliaries
const PylithScalar source = poroelasticContext.sourceDensity;

// Rheologic Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
g0[0] -= source;
g0[0] += pressure_t / biotModulus;
g0[0] += biotCoefficient * trace_strain_t;

g0[0] += source;
g0[0] -= biotCoefficient * trace_strain_t;
} // g0p_source_grav

// ----------------------------------------------------------------------
Expand Down Expand Up @@ -2050,15 +2068,19 @@ public:

// Solution Variables
const PylithScalar trace_strain_t = poroelasticContext.trace_strain_t;
const PylithScalar pressure_t = poroelasticContext.pressure_t;

// Rheology Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
const PylithScalar biotModulus = rheologyContext.biotModulus;

// Poroelastic Auxiliaries
const PylithScalar source = poroelasticContext.sourceDensity;

// Rheologic Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
g0[0] -= source;
g0[0] += pressure_t / biotModulus;
g0[0] += biotCoefficient * trace_strain_t;

g0[0] += source;
g0[0] -= biotCoefficient * trace_strain_t;
} // g0p_source_grav_body

// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -3891,11 +3913,16 @@ public:

// Solution Variables
const PylithScalar trace_strain_t = poroelasticContext.trace_strain_t;
const PylithScalar pressure_t = poroelasticContext.pressure_t;

// Rheology Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
const PylithScalar biotModulus = rheologyContext.biotModulus;

// Rheological Auxiliaries
g0[0] += pressure_t / biotModulus;
g0[0] += biotCoefficient * trace_strain_t;

g0[0] -= biotCoefficient * trace_strain_t;
} // g0p_implicit

// ----------------------------------------------------------------------
Expand Down Expand Up @@ -3938,13 +3965,18 @@ public:

// Solution Variables
const PylithScalar trace_strain_t = poroelasticContext.trace_strain_t;
const PylithScalar pressure_t = poroelasticContext.pressure_t;

// Rheology Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
const PylithScalar biotModulus = rheologyContext.biotModulus;

// Poroelastic Auxiliaries
const PylithScalar source = poroelasticContext.sourceDensity;
// Rheologic Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;

g0[0] += source;
g0[0] -= biotCoefficient * trace_strain_t;
g0[0] -= source;
g0[0] += pressure_t / biotModulus;
g0[0] += biotCoefficient * trace_strain_t;
} // g0p_source

// ----------------------------------------------------------------------
Expand Down Expand Up @@ -3987,13 +4019,19 @@ public:

// Solution Variables
const PylithScalar trace_strain_t = poroelasticContext.trace_strain_t;
const PylithScalar pressure_t = poroelasticContext.pressure_t;

// Rheology Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
const PylithScalar biotModulus = rheologyContext.biotModulus;

// Poroelastic Auxiliaries
const PylithScalar source = poroelasticContext.sourceDensity;
// Rheologic Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;

g0[0] += source;
g0[0] -= biotCoefficient * trace_strain_t;
g0[0] -= source;
g0[0] += pressure_t / biotModulus;
g0[0] += biotCoefficient * trace_strain_t;

} // g0p_source_body

// ----------------------------------------------------------------------
Expand Down Expand Up @@ -4036,13 +4074,18 @@ public:

// Solution Variables
const PylithScalar trace_strain_t = poroelasticContext.trace_strain_t;
const PylithScalar pressure_t = poroelasticContext.pressure_t;

// Rheology Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
const PylithScalar biotModulus = rheologyContext.biotModulus;

// Poroelastic Auxiliaries
const PylithScalar source = poroelasticContext.sourceDensity;
// Rheologic Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;

g0[0] += source;
g0[0] -= biotCoefficient * trace_strain_t;
g0[0] -= source;
g0[0] += pressure_t / biotModulus;
g0[0] += biotCoefficient * trace_strain_t;
} // g0p_source_grav

// ----------------------------------------------------------------------
Expand Down Expand Up @@ -4085,13 +4128,19 @@ public:

// Solution Variables
const PylithScalar trace_strain_t = poroelasticContext.trace_strain_t;
const PylithScalar pressure_t = poroelasticContext.pressure_t;

// Rheology Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;
const PylithScalar biotModulus = rheologyContext.biotModulus;

// Poroelastic Auxiliaries
const PylithScalar source = poroelasticContext.sourceDensity;
// Rheologic Auxiliaries
const PylithScalar biotCoefficient = rheologyContext.biotCoefficient;

g0[0] += source;
g0[0] -= biotCoefficient * trace_strain_t;
g0[0] -= source;
g0[0] += pressure_t / biotModulus;
g0[0] += biotCoefficient * trace_strain_t;

} // g0p_source_grav_body

// -----------------------------------------------------------------------------
Expand Down
16 changes: 8 additions & 8 deletions libsrc/pylith/materials/Poroelasticity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -457,20 +457,20 @@ pylith::materials::Poroelasticity::_setKernelsResidual(pylith::feassemble::Integ
// Displacement
const PetscPointFunc f0u = pylith::fekernels::Poroelasticity::f0u_explicit;
const PetscPointFunc f1u = NULL;
const PetscPointFunc g0u = NULL; // pylith::fekernels::Poroelasticity::g0u;
const PetscPointFunc g0u = NULL;
const PetscPointFunc g1u = NULL;

// Pressure
const PetscPointFunc f0p = _rheology->getKernelf0p_explicit(coordsys);
const PetscPointFunc f1p = NULL;
const PetscPointFunc g0p = _rheology->getKernelg0p(coordsys, _useBodyForce, _gravityField, _useSourceDensity);
const PetscPointFunc g1p = _rheology->getKernelg1p_explicit(coordsys, _gravityField); // Darcy velocity
const PetscPointFunc f0p = _rheology->getKernelg0p(coordsys, _useBodyForce, _gravityField, _useSourceDensity);
const PetscPointFunc f1p = _rheology->getKernelg1p_explicit(coordsys, _gravityField); // Darcy velocity;
const PetscPointFunc g0p = NULL;
const PetscPointFunc g1p = NULL;

// Velocity
const PetscPointFunc f0v = pylith::fekernels::Poroelasticity::f0v_explicit;
const PetscPointFunc f1v = NULL;
const PetscPointFunc g0v = r0;
const PetscPointFunc g1v = _rheology->getKernelg1v_explicit(coordsys);
const PetscPointFunc f1v = _rheology->getKernelg1v_explicit(coordsys);
const PetscPointFunc g0v = r0; // NEED TO MOVE TO LHS
const PetscPointFunc g1v = NULL;

kernels.resize(6);
kernels[0] = ResidualKernels("displacement", pylith::feassemble::Integrator::LHS, f0u, f1u);
Expand Down

0 comments on commit a3b8b47

Please sign in to comment.