[cig-commits] commit 2412 by heister to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Sun Apr 6 17:07:33 PDT 2014


Revision 2412

implement net translation

U   trunk/aspect/cookbooks/future/netrot.prm
A   trunk/aspect/cookbooks/future/nettranslation.prm
U   trunk/aspect/cookbooks/future/periodic_box.prm
U   trunk/aspect/source/simulator/nullspace.cc


http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=2412&peg=2412

Diff:
Modified: trunk/aspect/cookbooks/future/netrot.prm
===================================================================
--- trunk/aspect/cookbooks/future/netrot.prm	2014-04-06 22:49:45 UTC (rev 2411)
+++ trunk/aspect/cookbooks/future/netrot.prm	2014-04-07 00:07:30 UTC (rev 2412)
@@ -2,7 +2,7 @@
 # manual for more information.
 
 
-set Dimension                              = 2
+set Dimension                              = 3
 set Use years in output instead of seconds = true
 set End time                               = 1.5e9
 set Output directory                       = output
@@ -39,7 +39,7 @@
   set Include shear heating                   = true
 
   # net rotation|net translation|angular momentum|translational momentum
-  set Remove nullspace = net rotation
+  set Remove nullspace = #net rotation
 end
 
 
@@ -63,10 +63,10 @@
 
 
 subsection Mesh refinement
-  set Initial global refinement          = 4
-  set Initial adaptive refinement        = 0
+  set Initial global refinement          = 0
+  set Initial adaptive refinement        = 2
   set Strategy                           = temperature
-  set Time steps between mesh refinement = 10
+  set Time steps between mesh refinement = 5
 end
 
 

Added: trunk/aspect/cookbooks/future/nettranslation.prm
===================================================================
--- trunk/aspect/cookbooks/future/nettranslation.prm	                        (rev 0)
+++ trunk/aspect/cookbooks/future/nettranslation.prm	2014-04-07 00:07:30 UTC (rev 2412)
@@ -0,0 +1,106 @@
+set Dimension = 2
+set CFL number                             = 1.0
+set End time                               = 1e9
+set Output directory                       = output
+set Resume computation                     = false
+set Start time                             = 0
+set Adiabatic surface temperature          = 0
+set Surface pressure                       = 0
+set Pressure normalization = no
+set Linear solver tolerance = 1.e-7
+set Use years in output instead of seconds = true
+set Nonlinear solver scheme                = IMPES
+
+subsection Boundary temperature model
+  set Model name = box
+  subsection Box
+    set Top temperature = 0.0
+    set Bottom temperature = 1000.0
+  end
+end
+
+
+subsection Discretization
+  set Stokes velocity polynomial degree       = 2
+  set Temperature polynomial degree           = 2
+  set Use locally conservative discretization = false
+  subsection Stabilization parameters
+    set alpha = 2
+    set beta  = 0.078
+    set cR    = 0.5   # default: 0.11
+  end
+end
+
+
+subsection Geometry model
+  set Model name = box
+  subsection Box
+    set X periodic = true
+    set X extent = 1.e6 
+    set Y extent = 5.e5
+    set Z extent = 5.e5
+  end
+end
+
+
+subsection Gravity model
+  set Model name = vertical
+  subsection Vertical
+    set Magnitude = 10.0
+  end
+end
+
+
+subsection Initial conditions
+  set Model name = function
+  subsection Function 
+    set Variable names      = x,y
+    set Function expression = if((sqrt((x-1.e5)^2+(y-4.0e5)^2)<5.0e4) | (sqrt((x-3.e5)^2+(y-2.e5)^2)<1.0e5) , 800.0, 0)
+  end
+end
+
+
+subsection Material model
+  set Model name = simple
+  subsection Simple model
+    set Reference density             = 3300
+    set Reference specific heat       = 1250
+    set Reference temperature         = 0.0
+    set Thermal conductivity          = 4.7
+    set Thermal expansion coefficient = 4e-5
+    set Viscosity                     = 1.e20
+  end
+end
+
+
+subsection Mesh refinement
+  set Additional refinement times        =
+  set Initial adaptive refinement        = 2                       # default: 2
+  set Initial global refinement          = 6                       # default: 2
+  set Refinement fraction                = 0.3
+  set Coarsening fraction                = 0.03
+  set Strategy                           = thermal energy density
+  set Time steps between mesh refinement = 10                       # default: 10
+end
+
+
+subsection Model settings
+  set Include adiabatic heating               = false
+  set Include shear heating                   = false
+  set Radiogenic heating rate                 = 0
+  set Fixed temperature boundary indicators   = 2,3
+  set Prescribed velocity boundary indicators =
+  set Tangential velocity boundary indicators = 2,3
+  set Zero velocity boundary indicators       = 
+  set Remove nullspace = net translation
+end
+
+subsection Postprocess
+  set List of postprocessors = visualization
+  subsection Visualization
+    set List of output variables = 
+    set Number of grouped files       = 1
+    set Output format                 = vtu
+    set Time between graphical output = 1.e3
+  end
+end

Modified: trunk/aspect/cookbooks/future/periodic_box.prm
===================================================================
--- trunk/aspect/cookbooks/future/periodic_box.prm	2014-04-06 22:49:45 UTC (rev 2411)
+++ trunk/aspect/cookbooks/future/periodic_box.prm	2014-04-07 00:07:30 UTC (rev 2412)
@@ -90,8 +90,9 @@
   set Radiogenic heating rate                 = 0
   set Fixed temperature boundary indicators   = 2,3
   set Prescribed velocity boundary indicators =
-  set Tangential velocity boundary indicators = 
-  set Zero velocity boundary indicators       = 2,3
+  set Tangential velocity boundary indicators = 2,3
+  set Zero velocity boundary indicators       = 
+  set Remove nullspace = net translation
 end
 
 subsection Postprocess
@@ -100,6 +101,6 @@
     set List of output variables = 
     set Number of grouped files       = 1
     set Output format                 = vtu
-    set Time between graphical output = 1.e5
+    set Time between graphical output = 1.e3
   end
 end

Modified: trunk/aspect/source/simulator/nullspace.cc
===================================================================
--- trunk/aspect/source/simulator/nullspace.cc	2014-04-06 22:49:45 UTC (rev 2411)
+++ trunk/aspect/source/simulator/nullspace.cc	2014-04-07 00:07:30 UTC (rev 2412)
@@ -53,6 +53,16 @@
           virtual Tensor<1,dim> value (const Point<dim> &p) const { Tensor<1,dim> vel; if( dim == 2) cross_product(vel, p); else cross_product(vel, axis, p); return vel;}
       };
 
+    template <int dim>
+    class Translation : public TensorFunction<1,dim>
+    {
+      private:
+        const unsigned int direction;
+      public:
+        Translation(const unsigned int d) : direction(d) {}
+        virtual Tensor<1,dim> value(const Point<dim> &) const { return Tensor<1,dim>(Point<dim>::unit_vector(direction)); }
+    };
+
   }
 
   template <int dim>
@@ -62,19 +72,26 @@
         AssertThrow(false, ExcNotImplemented());
     if (parameters.nullspace_removal & NullspaceRemoval::translational_momentum)
         AssertThrow(false, ExcNotImplemented());
-    if (parameters.nullspace_removal & NullspaceRemoval::net_translation)
-        AssertThrow(false, ExcNotImplemented());
 
+    std::vector<std_cxx1x::shared_ptr<TensorFunction<1,dim> > > funcs;
+
     if (parameters.nullspace_removal & NullspaceRemoval::net_rotation)
       {
-        std::vector<std_cxx1x::shared_ptr<TensorFunction<1,dim> > > funcs;
-
         if (dim==2)
           funcs.push_back(std_cxx1x::shared_ptr<TensorFunction<1,dim> >(new internal::Rotation<dim>(0)));
         if (dim==3)
           for(unsigned int a=0; a<dim; ++a)
             funcs.push_back(std_cxx1x::shared_ptr<TensorFunction<1,dim> >(new internal::Rotation<dim>(a)));
+      }
 
+    if (parameters.nullspace_removal & NullspaceRemoval::net_translation)
+      {
+          for(unsigned int a=0; a<dim; ++a)
+            funcs.push_back(std_cxx1x::shared_ptr<TensorFunction<1,dim> >(new internal::Translation<dim>(a)));
+      }
+
+    if (funcs.size()>0)
+      {
         net_rotations_translations.resize(funcs.size());
         for (unsigned int i=0;i<funcs.size();++i)
           net_rotations_translations[i].reinit(
@@ -95,7 +112,8 @@
   template <int dim>
   void Simulator<dim>::remove_nullspace(LinearAlgebra::BlockVector &vector)
   {
-    if (parameters.nullspace_removal & NullspaceRemoval::net_rotation)
+    if (parameters.nullspace_removal & NullspaceRemoval::net_rotation ||
+        parameters.nullspace_removal & NullspaceRemoval::net_translation)
       {
         for(unsigned int i=0; i<net_rotations_translations.size(); ++i)
         {


More information about the CIG-COMMITS mailing list