[cig-commits] [commit] master: Add a test that currently fails. (c8ffeac)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed May 21 12:33:38 PDT 2014
Repository : https://github.com/geodynamics/aspect
On branch : master
Link : https://github.com/geodynamics/aspect/compare/a35e4f5e47a47903957f7c84c785299a49101c46...2df080f4905a6be43fd1729ea0d6a7a956cce070
>---------------------------------------------------------------
commit c8ffeacea823347396f60d1e80f25d80de08cc5b
Author: Wolfgang Bangerth <bangerth at math.tamu.edu>
Date: Wed May 21 12:32:09 2014 -0500
Add a test that currently fails.
>---------------------------------------------------------------
c8ffeacea823347396f60d1e80f25d80de08cc5b
.../time-dependent-temperature-bc.cc | 117 +++++++++++++++++----
..._flow.prm => time-dependent-temperature-bc.prm} | 80 ++++++++------
.../screen-output | 0
3 files changed, 148 insertions(+), 49 deletions(-)
diff --git a/source/boundary_temperature/box.cc b/tests/time-dependent-temperature-bc.cc
similarity index 59%
copy from source/boundary_temperature/box.cc
copy to tests/time-dependent-temperature-bc.cc
index d56533a..627e34c 100644
--- a/source/boundary_temperature/box.cc
+++ b/tests/time-dependent-temperature-bc.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2011 - 2014 by the authors of the ASPECT code.
+ Copyright (C) 2014 by the authors of the ASPECT code.
This file is part of ASPECT.
@@ -19,8 +19,89 @@
*/
-#include <aspect/boundary_temperature/box.h>
-#include <aspect/geometry_model/box.h>
+#ifndef __aspect__boundary_temperature_time_dep_box_h
+#define __aspect__boundary_temperature_time_dep_box_h
+
+#include <aspect/boundary_temperature/interface.h>
+#include <aspect/simulator_access.h>
+
+
+namespace aspect
+{
+ namespace BoundaryTemperature
+ {
+ /**
+ * A class that implements a temperature boundary condition for a time_dep_box
+ * geometry.
+ *
+ * @ingroup BoundaryTemperatures
+ */
+ template <int dim>
+ class Time_Dep_Box : public Interface<dim>, public SimulatorAccess<dim>
+ {
+ public:
+ /**
+ * Return the temperature that is to hold at a particular location on
+ * the boundary of the domain. This function returns constant
+ * temperatures at the left and right boundaries.
+ *
+ * @param geometry_model The geometry model that describes the domain.
+ * This may be used to determine whether the boundary temperature
+ * model is implemented for this geometry.
+ * @param boundary_indicator The boundary indicator of the part of the
+ * boundary of the domain on which the point is located at which we
+ * are requesting the temperature.
+ * @param location The location of the point at which we ask for the
+ * temperature.
+ */
+ virtual
+ double temperature (const GeometryModel::Interface<dim> &geometry_model,
+ const unsigned int boundary_indicator,
+ const Point<dim> &location) const;
+
+ /**
+ * Return the minimal the temperature on that part of the boundary on
+ * which Dirichlet conditions are posed.
+ *
+ * This value is used in computing dimensionless numbers such as the
+ * Nusselt number indicating heat flux.
+ */
+ virtual
+ double minimal_temperature (const std::set<types::boundary_id> &fixed_boundary_ids) const;
+
+ /**
+ * Return the maximal the temperature on that part of the boundary on
+ * which Dirichlet conditions are posed.
+ *
+ * This value is used in computing dimensionless numbers such as the
+ * Nusselt number indicating heat flux.
+ */
+ virtual
+ double maximal_temperature (const std::set<types::boundary_id> &fixed_boundary_ids) const;
+
+ /**
+ * Declare the parameters this class takes through input files. This
+ * class declares the inner and outer boundary temperatures.
+ */
+ static
+ void
+ declare_parameters (ParameterHandler &prm);
+
+ /**
+ * Read the parameters this class declares from the parameter file.
+ */
+ virtual
+ void
+ parse_parameters (ParameterHandler &prm);
+
+ private:
+ double temperature_[2*dim];
+ };
+ }
+}
+
+
+#endif
#include <utility>
#include <limits>
@@ -30,31 +111,31 @@ namespace aspect
{
namespace BoundaryTemperature
{
-// ------------------------------ Box -------------------
+// ------------------------------ Time_Dep_Box -------------------
template <int dim>
double
- Box<dim>::
+ Time_Dep_Box<dim>::
temperature (const GeometryModel::Interface<dim> &geometry_model,
const unsigned int boundary_indicator,
const Point<dim> &location) const
{
- // verify that the geometry is in fact a box since only
+ // verify that the geometry is in fact a time_dep_box since only
// for this geometry do we know for sure what boundary indicators it
// uses and what they mean
- Assert (dynamic_cast<const GeometryModel::Box<dim>*>(&geometry_model)
+ Assert (dynamic_cast<const GeometryModel::Time_Dep_Box<dim>*>(&geometry_model)
!= 0,
ExcMessage ("This boundary model is only implemented if the geometry is "
- "in fact a box."));
+ "in fact a time_dep_box."));
Assert (boundary_indicator<2*dim, ExcMessage ("Unknown boundary indicator."));
- return temperature_[boundary_indicator];
+ return temperature_[boundary_indicator] * this->get_time();
}
template <int dim>
double
- Box<dim>::
+ Time_Dep_Box<dim>::
minimal_temperature (const std::set<types::boundary_id> &fixed_boundary_ids) const
{
if (fixed_boundary_ids.empty())
@@ -75,7 +156,7 @@ namespace aspect
template <int dim>
double
- Box<dim>::
+ Time_Dep_Box<dim>::
maximal_temperature (const std::set<types::boundary_id> &fixed_boundary_ids) const
{
if (fixed_boundary_ids.empty())
@@ -94,11 +175,11 @@ namespace aspect
template <int dim>
void
- Box<dim>::declare_parameters (ParameterHandler &prm)
+ Time_Dep_Box<dim>::declare_parameters (ParameterHandler &prm)
{
prm.enter_subsection("Boundary temperature model");
{
- prm.enter_subsection("Box");
+ prm.enter_subsection("Time_Dep_Box");
{
prm.declare_entry ("Left temperature", "1",
Patterns::Double (),
@@ -130,11 +211,11 @@ namespace aspect
template <int dim>
void
- Box<dim>::parse_parameters (ParameterHandler &prm)
+ Time_Dep_Box<dim>::parse_parameters (ParameterHandler &prm)
{
prm.enter_subsection("Boundary temperature model");
{
- prm.enter_subsection("Box");
+ prm.enter_subsection("Time_Dep_Box");
{
switch (dim)
{
@@ -172,9 +253,9 @@ namespace aspect
{
namespace BoundaryTemperature
{
- ASPECT_REGISTER_BOUNDARY_TEMPERATURE_MODEL(Box,
- "box",
+ ASPECT_REGISTER_BOUNDARY_TEMPERATURE_MODEL(Time_Dep_Box,
+ "time_dep_box",
"A model in which the temperature is chosen constant on "
- "all the sides of a box.")
+ "all the sides of a time_dep_box.")
}
}
diff --git a/tests/no_flow.prm b/tests/time-dependent-temperature-bc.prm
similarity index 50%
copy from tests/no_flow.prm
copy to tests/time-dependent-temperature-bc.prm
index c7a8b0a..5b07e30 100644
--- a/tests/no_flow.prm
+++ b/tests/time-dependent-temperature-bc.prm
@@ -1,19 +1,14 @@
-# A test that deals with the problem that if there is no flow then the
-# convection time step is infinite. in that case, we need to limit the
-# time step size to something related to the conduction time step
-#
-# We make sure that there is no flow in this particular situation by using
-# zero boundary conditions and a zero thermal expansion coefficient so
-# that the right hand side of the velocity is constant.
+# originally taken from diffusion.prm, but intended to test that we can deal
+# with time dependent temperature boundary conditions
+
-set Dimension = 2
+set Dimension = 2
-set CFL number = 1.0
-set Use conduction timestep = true
+set CFL number = 0.01
-set End time = 1
+set End time = 4e7
set Resume computation = false
@@ -28,12 +23,16 @@ set Use years in output instead of seconds = false # default: true
set Nonlinear solver scheme = IMPES
+
subsection Boundary temperature model
- set Model name = box
+ set Model name = time_dep_box
+ subsection Time_Dep_Box
+ set Bottom temperature = 0
+ set Top temperature = 1 # the model interprets this as T(t)=1*t
+ end
end
-
subsection Discretization
set Stokes velocity polynomial degree = 2
@@ -56,7 +55,7 @@ subsection Geometry model
set Model name = box
subsection Box
- set X extent = 1
+ set X extent = 1 # default: 1
set Y extent = 1
@@ -72,7 +71,12 @@ end
subsection Initial conditions
- set Model name = perturbed box
+ set Model name = function
+
+ subsection Function
+ set Variable names = x,y
+ set Function expression = 0.0
+ end
end
@@ -81,28 +85,46 @@ subsection Material model
set Model name = simple
subsection Simple model
- set Thermal expansion coefficient = 0
- set Reference specific heat = 1
- set Thermal conductivity = 1
- set Reference density = 1
+ set Reference density = 1 # default: 3300
+
+ set Reference specific heat = 1250
+
+ set Reference temperature = 0 # default: 293
+
+ set Thermal conductivity = 1e-6 # default: 4.7
+
+ set Thermal expansion coefficient = 2e-5
+
+ set Viscosity = 1 # default: 5e24
end
+
end
subsection Mesh refinement
+ set Additional refinement times =
+
set Initial adaptive refinement = 0 # default: 2
- set Initial global refinement = 2 # default: 2
- set Strategy = density, temperature
+ set Initial global refinement = 5 # default: 2
+
+ set Refinement fraction = 0.3
+
+ set Coarsening fraction = 0.05
+
+ set Strategy = thermal energy density
+
+ set Time steps between mesh refinement = 5 # default: 10
end
subsection Model settings
set Include adiabatic heating = false
+
set Include shear heating = false # default: true
- set Fixed temperature boundary indicators = 0, 1
+ set Fixed temperature boundary indicators = 2, 3
set Prescribed velocity boundary indicators =
@@ -111,15 +133,11 @@ subsection Model settings
set Zero velocity boundary indicators =
end
+subsection Checkpointing
+ set Time between checkpoint = 0
+ set Steps between checkpoint = 50
+end
subsection Postprocess
- set List of postprocessors = visualization
-
- subsection Visualization
- set Number of grouped files = 0
-
- set Output format = gnuplot
-
- set Time between graphical output = 0 # default: 1e8
- end
+ set List of postprocessors = temperature statistics
end
diff --git a/tests/diffusion/screen-output b/tests/time-dependent-temperature-bc/screen-output
similarity index 100%
copy from tests/diffusion/screen-output
copy to tests/time-dependent-temperature-bc/screen-output
More information about the CIG-COMMITS
mailing list