# My 3D simulation doesn't represent correctly the temperature field of my ASCII file

**URL:** <https://community.geodynamics.org/t/my-3d-simulation-doesnt-represent-correctly-the-temperature-field-of-my-ascii-file/3503>\
**Category:** ASPECT\
**Created:** [June 12, 2024, 12:25pm UTC](https://community.geodynamics.org/t/my-3d-simulation-doesnt-represent-correctly-the-temperature-field-of-my-ascii-file/3503 "2024-06-12T12:25:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francyrad](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@Francyrad](https://community.geodynamics.org/u/Francyrad)\
**Post date:** [June 12, 2024, 12:25pm UTC](https://community.geodynamics.org/t/my-3d-simulation-doesnt-represent-correctly-the-temperature-field-of-my-ascii-file/3503/1 "2024-06-12T12:25:43Z")

</div>

Dear users,

I need to run a 3D simulation using Steinberger’s material model with a particular temperature field that is not reproducible in muparser. So, I created an ASCII file generated by a Python script.

This is the result that I want:

![Schermata del 2024-05-06 23-03-51](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/c/c8d2ce303507160ec738154735eee6fb8f56fa8f.png)

It shows a mega hot perturbation surrounded by four cold perturbations. Around these, there are small perturbations. All the perturbations are present also in depth.

My ASCII file is well read by ASPECT, but when I start the simulation and see the first file, these perturbations do not look like I wanted:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/2/2cba5dd94a8988bc8a01f485b821577d09b7f782.jpeg)

I’m sure this is an ASPECT problem. I created a Python script that lets me see the produced ASCII file, and it looks correct. My theory is that, in some way, the meshes deform my geometries. As you can see from the following ParaView screenshot, the deformation follows the mesh grid:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/2/24730e18ecd1e1f0087e16efb0e919f730876e2b.jpeg)

Is there a way to solve this problem? I really need this for an article. This is my mesh setup:

```auto
subsection Solver parameters
  subsection Stokes solver parameters
    set Stokes solver type = block GMG
  end
end

subsection Mesh refinement
  set Initial adaptive refinement = 0

  set Initial global refinement = 4
  set Minimum refinement level = 3  
  set Refinement fraction = 0.4
  set Coarsening fraction = 0.05

  set Strategy = nonadiabatic temperature,minimum refinement function, composition, viscosity, boundary

  set Time steps between mesh refinement = 3

  subsection Boundary
    set Boundary refinement indicators = top, bottom
  end

  subsection Minimum refinement function
    set Function constants =
    set Function expression = if (depth > 2500000,4,if(depth > 500000,2,if(depth > 80000,4,4)))
    set Variable names = depth,y,z
  end
end

```

Is that caused by GMG block? If I don’t use it, my simulation becomes impossibly slow. It seems like my planet is made of rhomboidal meshes instead of a uniform grid…

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/5/56085b7213ec17ac2daecb69dca81630c8d06d5f.jpeg)

Thank you all for your future help.

---

<div class="post-metadata">

**Author:** ![bobmyhill](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bobmyhill/32/38_2.png) [@bobmyhill](https://community.geodynamics.org/u/bobmyhill)\
**Post date:** [June 12, 2024, 2:19pm UTC](https://community.geodynamics.org/t/my-3d-simulation-doesnt-represent-correctly-the-temperature-field-of-my-ascii-file/3503/2 "2024-06-12T14:19:21Z")

</div>

Dear francyrad,

Please post a minimal working ascii file and prm that demonstrates your problem (i.e. simplify your ascii file so that it is small and make your prm simple so that we can run it quickly).

Best wishes,  
Bob

---

<div class="post-metadata">

**Author:** ![bangerth](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bangerth/32/52_2.png) [@bangerth](https://community.geodynamics.org/u/bangerth)\
**Post date:** [June 12, 2024, 2:58pm UTC](https://community.geodynamics.org/t/my-3d-simulation-doesnt-represent-correctly-the-temperature-field-of-my-ascii-file/3503/3 "2024-06-12T14:58:30Z")

</div>

Separately: The way to debug this is to choose a solver like “no Stokes, no advection” that only interpolates the initial conditions. This way you know that that is what you’re looking at.

My best guess is that the picture is a confusion of coordinate systems such as using latitude in the input file when ASPECT wants to see colatitude, or similar.

Best  
W.

---

<div class="post-metadata">

**Author:** ![Francyrad](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@Francyrad](https://community.geodynamics.org/u/Francyrad)\
**Post date:** [June 12, 2024, 5:23pm UTC](https://community.geodynamics.org/t/my-3d-simulation-doesnt-represent-correctly-the-temperature-field-of-my-ascii-file/3503/4 "2024-06-12T17:23:14Z")

</div>

Here is a simple .prm and the ascii file, the problem is still present.

I tried to replicate the example ASCII file 3D  
[perturbation.prm](https://community.geodynamics.org/uploads/short-url/lGHKpnvIYdwJALxVLSGAJ3PVsUp.prm) (2.4 KB)

> **[superplume\_3d.txt](https://drive.google.com/file/d/1fjbOeUVYRPP9bfOrNFc9RNxC2JeyiAyp/view?usp=sharing)**
>
> Google Drive file.

I hope that the problem is related to coordinates instead of meshes…

---

<div class="post-metadata">

**Author:** ![bangerth](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bangerth/32/52_2.png) [@bangerth](https://community.geodynamics.org/u/bangerth)\
**Post date:** [June 13, 2024, 3:07am UTC](https://community.geodynamics.org/t/my-3d-simulation-doesnt-represent-correctly-the-temperature-field-of-my-ascii-file/3503/5 "2024-06-13T03:07:35Z")

</div>

@Francyrad Like I said, you can still make this simpler. Remove the adiabatic temperature profile, set the end time to zero, remove the solver. I still think that it is a coordinate confusion issue.

Best  
W.

---

<div class="post-metadata">

**Author:** ![bobmyhill](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bobmyhill/32/38_2.png) [@bobmyhill](https://community.geodynamics.org/u/bobmyhill)\
**Post date:** [June 13, 2024, 11:19am UTC](https://community.geodynamics.org/t/my-3d-simulation-doesnt-represent-correctly-the-temperature-field-of-my-ascii-file/3503/6 "2024-06-13T11:19:39Z")

</div>

Both phi and theta in your lookup table go from 0 to 2\*pi. You should fix your table and check that you understand what “theta” means: [phi theta spherical coordinates - Google Search](https://www.google.com/search?q=phi+theta+spherical+coordinates)

Once your table is correct, check the ASPECT output again and let us know what you find.

Best wishes,  
Bob

---

<div class="post-metadata">

**Author:** ![Francyrad](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@Francyrad](https://community.geodynamics.org/u/Francyrad)\
**Post date:** [June 14, 2024, 12:42pm UTC](https://community.geodynamics.org/t/my-3d-simulation-doesnt-represent-correctly-the-temperature-field-of-my-ascii-file/3503/7 "2024-06-14T12:42:11Z")

</div>

Thank you all, you were right, it was a coordinate problem. I did confusion in my script and this resulted in unwanted bug, now it works:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/1/1da6f038213f6d3ad32747353f708760c4175d6c.jpeg)

I’ll do a cookbook for a shell 3D as soon as i can

Best

Francesco
