[cig-commits] r5755 - mc/3D/CitcomS/branches/compressible/lib
tan2 at geodynamics.org
tan2 at geodynamics.org
Wed Jan 10 14:01:50 PST 2007
Author: tan2
Date: 2007-01-10 14:01:50 -0800 (Wed, 10 Jan 2007)
New Revision: 5755
Added:
mc/3D/CitcomS/branches/compressible/lib/Material_properties.c
mc/3D/CitcomS/branches/compressible/lib/material_properties.h
Modified:
mc/3D/CitcomS/branches/compressible/lib/Element_calculations.c
mc/3D/CitcomS/branches/compressible/lib/Instructions.c
mc/3D/CitcomS/branches/compressible/lib/Makefile.am
mc/3D/CitcomS/branches/compressible/lib/Pan_problem_misc_functions.c
mc/3D/CitcomS/branches/compressible/lib/global_defs.h
Log:
Taking variable density field into the calculation of thermal buoyancy
Modified: mc/3D/CitcomS/branches/compressible/lib/Element_calculations.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Element_calculations.c 2007-01-10 21:59:32 UTC (rev 5754)
+++ mc/3D/CitcomS/branches/compressible/lib/Element_calculations.c 2007-01-10 22:01:50 UTC (rev 5755)
@@ -32,6 +32,7 @@
#include <math.h>
#include "element_definitions.h"
#include "global_defs.h"
+#include "material_properties.h"
@@ -77,6 +78,7 @@
const int nel=E->lmesh.nel;
const int lev=E->mesh.levmax;
+ density(E, E->rho);
thermal_buoyancy(E,E->buoyancy);
for(m=1;m<=E->sphere.caps_per_proc;m++) {
Modified: mc/3D/CitcomS/branches/compressible/lib/Instructions.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Instructions.c 2007-01-10 21:59:32 UTC (rev 5754)
+++ mc/3D/CitcomS/branches/compressible/lib/Instructions.c 2007-01-10 22:01:50 UTC (rev 5755)
@@ -43,6 +43,7 @@
#include "citcom_init.h"
#include "initial_temperature.h"
#include "lith_age.h"
+#include "material_properties.h"
#include "output.h"
#include "output_h5.h"
#include "parallel_related.h"
@@ -467,6 +468,10 @@
} /* end for cap j */
+ /* density field */
+ E->rho = (double *) malloc((nno+1)*sizeof(double));
+
+ /* horizontal average */
E->Have.T = (float *)malloc((E->lmesh.noz+2)*sizeof(float));
E->Have.V[1] = (float *)malloc((E->lmesh.noz+2)*sizeof(float));
E->Have.V[2] = (float *)malloc((E->lmesh.noz+2)*sizeof(float));
@@ -585,6 +590,7 @@
for(i=1;i<=E->lmesh.npno;i++)
E->P[j][i] = 0.0;
+ mat_prop_allocate(E);
phase_change_allocate(E);
set_up_nonmg_aliases(E,j);
Modified: mc/3D/CitcomS/branches/compressible/lib/Makefile.am
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Makefile.am 2007-01-10 21:59:32 UTC (rev 5754)
+++ mc/3D/CitcomS/branches/compressible/lib/Makefile.am 2007-01-10 22:01:50 UTC (rev 5755)
@@ -80,6 +80,8 @@
interuption.h \
lith_age.h \
Lith_age.c \
+ Material_properties.c \
+ material_properties.h \
Nodal_mesh.c \
Output.c \
output.h \
Added: mc/3D/CitcomS/branches/compressible/lib/Material_properties.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Material_properties.c 2007-01-10 21:59:32 UTC (rev 5754)
+++ mc/3D/CitcomS/branches/compressible/lib/Material_properties.c 2007-01-10 22:01:50 UTC (rev 5755)
@@ -0,0 +1,70 @@
+/*
+ *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *<LicenseText>
+ *
+ * CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
+ * Clint Conrad, Michael Gurnis, and Eun-seo Choi.
+ * Copyright (C) 1994-2005, California Institute of Technology.
+ *
+ * This program 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *</LicenseText>
+ *
+ *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "global_defs.h"
+#include "material_properties.h"
+
+
+void mat_prop_allocate(struct All_variables *E)
+{
+ int noz = E->lmesh.noz;
+ int nno = E->lmesh.nno;
+
+ /* reference density profile */
+ E->rhoref = (double *) malloc((noz+1)*sizeof(double));
+
+ /* coefficient of thermal expansion */
+ E->thermexp = (double *) malloc((noz+1)*sizeof(double));
+
+
+}
+
+
+void density(struct All_variables *E, double *rho)
+{
+ int i;
+ for(i=1; i<=E->lmesh.nno; i++) {
+ rho[i] = 1;
+ }
+
+}
+
+
+void thermal_expansion(struct All_variables *E, double *thermexp)
+{
+ int i;
+ for(i=1; i<=E->lmesh.noz; i++) {
+ thermexp[i] = 1;
+ }
+}
+
+
Modified: mc/3D/CitcomS/branches/compressible/lib/Pan_problem_misc_functions.c
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/Pan_problem_misc_functions.c 2007-01-10 21:59:32 UTC (rev 5754)
+++ mc/3D/CitcomS/branches/compressible/lib/Pan_problem_misc_functions.c 2007-01-10 22:01:50 UTC (rev 5755)
@@ -135,8 +135,10 @@
temp = E->control.Atemp;
for(m=1;m<=E->sphere.caps_per_proc;m++)
- for(i=1;i<=E->lmesh.nno;i++)
- buoy[m][i] = temp * E->T[m][i];
+ for(i=1;i<=E->lmesh.nno;i++) {
+ int nz = ((i-1) % E->lmesh.noz) + 1;
+ buoy[m][i] = temp * E->rho[i] * E->thermexp[nz] * E->T[m][i];
+ }
phase_change_apply_410(E, buoy);
phase_change_apply_670(E, buoy);
Modified: mc/3D/CitcomS/branches/compressible/lib/global_defs.h
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/global_defs.h 2007-01-10 21:59:32 UTC (rev 5754)
+++ mc/3D/CitcomS/branches/compressible/lib/global_defs.h 2007-01-10 22:01:50 UTC (rev 5755)
@@ -725,6 +725,7 @@
double *BI[MAX_LEVELS][NCS],*BPI[MAX_LEVELS][NCS];
double *P[NCS],*F[NCS],*H[NCS],*S[NCS],*U[NCS];
+ double *rho, *rhoref, *thermexp;
double *T[NCS],*Tdot[NCS],*buoyancy[NCS];
double *u1[NCS];
double *temp[NCS],*temp1[NCS];
Added: mc/3D/CitcomS/branches/compressible/lib/material_properties.h
===================================================================
--- mc/3D/CitcomS/branches/compressible/lib/material_properties.h 2007-01-10 21:59:32 UTC (rev 5754)
+++ mc/3D/CitcomS/branches/compressible/lib/material_properties.h 2007-01-10 22:01:50 UTC (rev 5755)
@@ -0,0 +1,32 @@
+/*
+ *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *<LicenseText>
+ *
+ * CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
+ * Clint Conrad, Michael Gurnis, and Eun-seo Choi.
+ * Copyright (C) 1994-2005, California Institute of Technology.
+ *
+ * This program 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *</LicenseText>
+ *
+ *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+
+
+void mat_prop_allocate(struct All_variables *E);
+void density(struct All_variables *E, double *rho);
+
More information about the cig-commits
mailing list