You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/man/AdvTwoD.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ The tracers can also be advected parallel by defining the maximum number of thre
107
107
108
108
Tracers can carry different properties such as absolute temperature or phase identification number (ID). For temperature, interpolation between centroids and tracer positions is required. Note that this implementation currently does not support fully coupled temperature-momentum simulations.
109
109
110
-
Alternatively, phase IDs (linked to properties like constant density or viscosity) can be advected to simulate compositional heterogeneity. Property interpolation is performed at vertices or centroids depending on the required context (e.g., viscosity for the momentum equations).
110
+
Alternatively, phase IDs (linked to properties like constant density or viscosity) can be advected to simulate compositional heterogeneity. Property interpolation is performed at vertices or centroids depending on the required context (e.g., viscosity for the momentum equations). For the centroids, the extended centroid field must be used.
111
111
112
112
Caution is required when interpolating properties between the grid and tracers, especially when those properties influence the governing equations (e.g., viscosity in momentum conservation).
Copy file name to clipboardExpand all lines: docs/src/man/Ini.md
+47-51Lines changed: 47 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Initial Conditions
1
+
# Specific Initialization
2
2
3
3
`GeoModBox.jl` includes several [routines](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/src/InitialCondition/2Dini.jl) or [structures](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/src/Structures.jl) to define certain parameters or initialize specific anomalies. The initial conditions can be specified for properties defined on their corresponding grid (i.e., temperature, velocity, or phase) or for tracers.
The following velocity configurations are currently supported:
@@ -57,7 +57,6 @@ The input parameters are:
57
57
- type - Parameter defining the type (see above)
58
58
- D - Structure or tuple containing the field arrays
59
59
- VBC - Structure or tuple containing the velocity boundary conditions
60
-
- NC - Structure or tuple containing the centroids parameter
61
60
- NV - Structure or tuple containing the vertices parameter
62
61
- Δ - Structure or tuple containing the grid resolution
63
62
- M - Structure or tuple containing the geometry
@@ -121,7 +120,7 @@ The following steps are required to use tracers:
121
120
122
121
**1. Tracer initialization**
123
122
124
-
To initialize the tracers, one needs to define the number per cell, wanted noise, and what property should be advected. The remaining parameters are the general `tuples` or `structures` used in `GeoModBox.jl`.
123
+
To initialize the tracers, one needs to define the number per cell, wanted noise, and what property should be advected. The tracer properties can be interpolated to the centroids or vertices using a bilinear interpoltion scheme. For the centroids, the extended centroid field must be used. The remaining parameters are the general `tuples` or `structures` used in `GeoModBox.jl`.
125
124
126
125
Following the definition of the required parameters for the tracer advection, the initial tracer position can be defined via the function
127
126
@@ -151,26 +150,23 @@ To advect the temperature, the initialization is called, for example, like [here
151
150
152
151
```julia
153
152
# Tracer Initialization ---
154
-
nmx,nmy =3,3# tracer per cell in x and y direction
155
-
noise =1# add noise to the initial position
156
-
nmark = nmx*nmy*NC.x*NC.y # total number of tracers
157
-
Aparam = :thermal # Property to be advected
158
-
# Tuple required for the tracer count
153
+
nmx,nmy =3,3
154
+
noise =1
155
+
nmark = nmx*nmy*NC.x*NC.y
156
+
Aparam = :thermal
159
157
MPC = (
160
-
c = zeros(Float64,(NC.x,NC.y)),# per centroid
161
-
v = zeros(Float64,(NV.x,NV.y)),# per vertices
162
-
th = zeros(Float64,(nthreads(),NC.x,NC.y)),# per thread
163
-
thv = zeros(Float64,(nthreads(),NV.x,NV.y)),# per thread
158
+
c = zeros(Float64,(NC.x,NC.y)),
159
+
v = zeros(Float64,(NV.x,NV.y)),
160
+
th = zeros(Float64,(nthreads(),NC.x,NC.y)),
161
+
thv = zeros(Float64,(nthreads(),NV.x,NV.y)),
164
162
)
165
-
# Tuple for the tracer count and the weighting
166
-
MPC1 = (
167
-
PG_th = [similar(D.T) for _ =1:nthreads()], # per thread
168
-
PV_th = [similar(D.wtv) for _ =1:nthreads()], # per thread
169
-
wt_th = [similar(D.wt) for _ =1:nthreads()], # per thread
170
-
wtv_th = [similar(D.wtv) for _ =1:nthreads()], # per thread
163
+
MAVG = (
164
+
PC_th = [similar(D.wte) for _ =1:nthreads()], # per thread
165
+
PV_th = [similar(D.wtv) for _ =1:nthreads()], # per thread
166
+
wte_th = [similar(D.wte) for _ =1:nthreads()], # per thread
167
+
wtv_th = [similar(D.wtv) for _ =1:nthreads()], # per thread
171
168
)
172
-
MPC = merge(MPC,MPC1)
173
-
# Function to initialize tracer distribution
169
+
# MPC = merge(MPC,MPC1)
174
170
Ma = IniTracer2D(Aparam,nmx,nmy,Δ,M,NC,noise,0,0)
175
171
# RK4 weights ---
176
172
rkw =1.0/6.0*[1.02.02.01.0] # for averaging
@@ -179,7 +175,7 @@ rkv = 1.0/2.0*[1.0 1.0 2.0 2.0] # for time stepping
179
175
@threads for k =1:nmark
180
176
Ma.T[k] = FromCtoM(D.T_ex, k, Ma, x, y, Δ, NC)
181
177
end
182
-
# Count tracer per cell ---
178
+
# Count marker per cell ---
183
179
CountMPC(Ma,nmark,MPC,M,x,y,Δ,NC,NV,1)
184
180
```
185
181
@@ -192,32 +188,32 @@ noise = 0
192
188
nmark = nmx*nmy*NC.x*NC.y
193
189
Aparam = :phase
194
190
MPC = (
195
-
c = zeros(Float64,(NC.x,NC.y)),
196
-
v = zeros(Float64,(NV.x,NV.y)),
197
-
th = zeros(Float64,(nthreads(),NC.x,NC.y)),
198
-
thv = zeros(Float64,(nthreads(),NV.x,NV.y)),
191
+
c = zeros(Float64,(NC.x,NC.y)),
192
+
v = zeros(Float64,(NV.x,NV.y)),
193
+
th = zeros(Float64,(nthreads(),NC.x,NC.y)),
194
+
thv = zeros(Float64,(nthreads(),NV.x,NV.y)),
199
195
)
200
-
MPC1= (
201
-
PG_th= [similar(D.ρ) for _ =1:nthreads()],# per thread
202
-
PV_th = [similar(D.ηv) for _ =1:nthreads()], # per thread
203
-
wt_th= [similar(D.wt) for _ =1:nthreads()],# per thread
204
-
wtv_th = [similar(D.wtv) for _ =1:nthreads()], # per thread
196
+
MAVG= (
197
+
PC_th = [similar(D.wte) for _ =1:nthreads()], # per thread
198
+
PV_th = [similar(D.ηv) for _ =1:nthreads()], # per thread
199
+
wte_th = [similar(D.wte) for _ =1:nthreads()], # per thread
200
+
wtv_th = [similar(D.wtv) for _ =1:nthreads()], # per thread
205
201
)
206
-
MPC = merge(MPC,MPC1)
202
+
#MPC = merge(MPC,MPC1)
207
203
Ma = IniTracer2D(Aparam,nmx,nmy,Δ,M,NC,noise,Ini.p,phase)
The advection of the phase and the update of the corresponding grid parameters is called, for example, like [here](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/examples/StokesEquation/2D/FallingBlockVarEta_DC.jl):
@@ -268,14 +264,14 @@ The advection of the phase and the update of the corresponding grid parameters i
>**Note:** The tracer distribution and interpolation of tracer properties to the centroids or vertices is a very helpful feature to initialize different, more complex model setups. This will be part of future implementations.
0 commit comments