[cig-commits] [commit] master: Add the old radiogenic heating functionality in a new heating model constant heating. (15d64fa)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri May 16 18:39:31 PDT 2014


Repository : https://github.com/geodynamics/aspect

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/7b658caa05d489ae3f8d61b8049b015e7be94f77...cc43d3ac6f571573118eb54c2103bf92dfe8355f

>---------------------------------------------------------------

commit 15d64fae4bab5fd9eb6ca248ee615d01506d2ede
Author: Rene Gassmoeller <R.Gassmoeller at mailbox.org>
Date:   Fri May 16 08:52:33 2014 -0500

    Add the old radiogenic heating functionality in a new heating model constant heating.


>---------------------------------------------------------------

15d64fae4bab5fd9eb6ca248ee615d01506d2ede
 .../constant_heating.h}                            | 38 +++++----
 source/heating_model/constant_heating.cc           | 89 ++++++++++++++++++++++
 2 files changed, 113 insertions(+), 14 deletions(-)

diff --git a/include/aspect/gravity_model/vertical.h b/include/aspect/heating_model/constant_heating.h
similarity index 60%
copy from include/aspect/gravity_model/vertical.h
copy to include/aspect/heating_model/constant_heating.h
index f67b129..e9756a0 100644
--- a/include/aspect/gravity_model/vertical.h
+++ b/include/aspect/heating_model/constant_heating.h
@@ -20,33 +20,43 @@
 /*  $Id$  */
 
 
-#ifndef __aspect__gravity_model_vertical_h
-#define __aspect__gravity_model_vertical_h
+#ifndef __aspect__heating_model_constant_heating_h
+#define __aspect__heating_model_constant_heating_h
 
-#include <aspect/gravity_model/interface.h>
+#include <aspect/heating_model/interface.h>
 
 namespace aspect
 {
-  namespace GravityModel
+  namespace HeatingModel
   {
     using namespace dealii;
 
     /**
-     * A class that describes gravity as a vector of constant magnitude
-     * pointing vertically down.
+     * A class that implements a constant radiogenic heating rate.
      *
-     * @ingroup GravityModels
+     * @ingroup HeatingModels
      */
     template <int dim>
-    class Vertical : public Interface<dim>
+    class ConstantHeating : public Interface<dim>
     {
       public:
         /**
-         * Return the gravity vector as a function of position.
+         * Return the specific heating rate. For the
+         * current class, this function obviously simply returns a
+         * constant value.
          */
-        virtual Tensor<1,dim> gravity_vector (const Point<dim> &position) const;
+        virtual
+        double
+        specific_heating_rate (const double,
+                               const double,
+                               const std::vector<double> &,
+                               const Point<dim> &) const;
 
         /**
+         * @name Functions used in dealing with run-time parameters
+         * @{
+         */
+        /**
          * Declare the parameters this class takes through input files.
          */
         static
@@ -59,15 +69,15 @@ namespace aspect
         virtual
         void
         parse_parameters (ParameterHandler &prm);
-
-      private:
         /**
-         * Magnitude of the gravity vector.
+         * @}
          */
-        double gravity_magnitude;
 
+      private:
+        double radiogenic_heating_rate;
     };
   }
 }
 
+
 #endif
diff --git a/source/heating_model/constant_heating.cc b/source/heating_model/constant_heating.cc
new file mode 100644
index 0000000..691a402
--- /dev/null
+++ b/source/heating_model/constant_heating.cc
@@ -0,0 +1,89 @@
+/*
+  Copyright (C) 2011 - 2014 by the authors of the ASPECT code.
+
+  This file is part of ASPECT.
+
+  ASPECT 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 2, or (at your option)
+  any later version.
+
+  ASPECT 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 ASPECT; see the file doc/COPYING.  If not see
+  <http://www.gnu.org/licenses/>.
+*/
+/*  $Id$  */
+
+
+#include <aspect/heating_model/constant_heating.h>
+
+
+namespace aspect
+{
+  namespace HeatingModel
+  {
+    template <int dim>
+    double
+    ConstantHeating<dim>::
+    specific_heating_rate (const double,
+        const double,
+        const std::vector<double> &,
+        const Point<dim> &) const
+    {
+      // return a constant value
+      return radiogenic_heating_rate;
+    }
+
+    template <int dim>
+    void
+    ConstantHeating<dim>::declare_parameters (ParameterHandler &prm)
+    {
+      prm.enter_subsection("Heating model");
+      {
+        prm.enter_subsection("Constant heating");
+        {
+          prm.declare_entry ("Radiogenic heating rate", "0",
+                             Patterns::Double (0),
+                             "The value of the specific radiogenic heating rate. "
+                             "Units: $W/kg$.");
+        }
+        prm.leave_subsection();
+      }
+      prm.leave_subsection();
+    }
+
+
+
+    template <int dim>
+    void
+    ConstantHeating<dim>::parse_parameters (ParameterHandler &prm)
+    {
+      prm.enter_subsection("Heating model");
+      {
+        prm.enter_subsection("Constant heating");
+        {
+          radiogenic_heating_rate    = prm.get_double ("Radiogenic heating rate");
+        }
+        prm.leave_subsection();
+      }
+      prm.leave_subsection();
+    }
+  }
+}
+
+// explicit instantiations
+namespace aspect
+{
+  namespace HeatingModel
+  {
+    ASPECT_REGISTER_HEATING_MODEL(ConstantHeating,
+                                  "constant heating",
+                                  "Implementation of a model in which the heating "
+                                  "rate is constant.")
+  }
+}



More information about the CIG-COMMITS mailing list