PISM, A Parallel Ice Sheet Model stable 0.4.1779

src/base/basal_strength/basal_resistance.cc

Go to the documentation of this file.
00001 // Copyright (C) 2004-2011 Jed Brown, Ed Bueler, and Constantine Khroulev
00002 //
00003 // This file is part of PISM.
00004 //
00005 // PISM is free software; you can redistribute it and/or modify it under the
00006 // terms of the GNU General Public License as published by the Free Software
00007 // Foundation; either version 2 of the License, or (at your option) any later
00008 // version.
00009 //
00010 // PISM is distributed in the hope that it will be useful, but WITHOUT ANY
00011 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00012 // FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00013 // details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with PISM; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019 #include "basal_resistance.hh"
00020 #include "pism_const.hh"
00021 #include "enthalpyConverter.hh"
00022 
00023 IceBasalResistancePlasticLaw::IceBasalResistancePlasticLaw(
00024              PetscScalar regularizationConstant, bool pseudoPlastic,
00025              PetscScalar pseudoExponent, PetscScalar pseudoUThreshold) {
00026   plastic_regularize = regularizationConstant;
00027   pseudo_plastic = pseudoPlastic;
00028   pseudo_q = pseudoExponent;
00029   pseudo_u_threshold = pseudoUThreshold;
00030 }
00031 
00032 PetscErrorCode IceBasalResistancePlasticLaw::printInfo(int verbthresh, MPI_Comm com) {
00033   PetscErrorCode ierr;
00034   if (pseudo_plastic == PETSC_TRUE) {
00035     if (pseudo_q == 1.0) {
00036       ierr = verbPrintf(verbthresh, com, 
00037         "Using linearly viscous till with u_threshold = %.2f m/a.\n", 
00038         pseudo_u_threshold * secpera); CHKERRQ(ierr);
00039     } else {
00040       ierr = verbPrintf(verbthresh, com, 
00041         "Using pseudo-plastic till with eps = %10.5e m/a, q = %.4f,"
00042         " and u_threshold = %.2f m/a.\n", 
00043         plastic_regularize * secpera, pseudo_q, pseudo_u_threshold * secpera); 
00044         CHKERRQ(ierr);
00045     }
00046   } else {
00047     ierr = verbPrintf(verbthresh, com, 
00048       "Using purely plastic till with eps = %10.5e m/a.\n",
00049       plastic_regularize * secpera); CHKERRQ(ierr);
00050   }
00051   return 0;
00052 }
00053 
00054 
00056 
00071 PetscScalar IceBasalResistancePlasticLaw::drag(PetscScalar tauc,
00072                                    PetscScalar vx, PetscScalar vy) {
00073   const PetscScalar magreg2 = PetscSqr(plastic_regularize) + PetscSqr(vx) + PetscSqr(vy);
00074   if (pseudo_plastic == PETSC_TRUE) {
00075     return tauc * pow(magreg2, 0.5*(pseudo_q - 1)) * pow(pseudo_u_threshold, -pseudo_q);
00076   } else { // pure plastic, but regularized
00077     return tauc / sqrt(magreg2);
00078   }
00079 }
00080 
00081 // Derivative of drag with respect to \f$ \alpha = \frac 1 2 (u_x^2 + u_y^2) \f$
00082 void IceBasalResistancePlasticLaw::dragWithDerivative(PetscReal tauc, PetscScalar vx, PetscScalar vy,
00083                                                       PetscScalar *d, PetscScalar *dd) const
00084 {
00085   const PetscScalar magreg2 = PetscSqr(plastic_regularize) + PetscSqr(vx) + PetscSqr(vy);
00086   if (pseudo_plastic == PETSC_TRUE) {
00087     *d = tauc * pow(magreg2, 0.5*(pseudo_q - 1)) * pow(pseudo_u_threshold, -pseudo_q);
00088     if (dd) *dd = (pseudo_q - 1) * *d / magreg2;
00089   } else { // pure plastic, but regularized
00090     *d = tauc / sqrt(magreg2);
00091     if (dd) *dd = -1 * *d / magreg2;
00092   }
00093 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines