sandbox/acastillo/input_fields/readme
Input Fields
This module provides routines to read existing simulation results and use them as initial conditions for new simulations.
initial_condition_2Dto3D()
Location: initial_conditions_2Dto3D.h
Description: Reads 2D simulation results from a binary file in a format compatible with the GNUplot binary matrix format (double precision). The 2D results are used to initialize a 3D simulation. This is useful for:
- Reducing computational cost by avoiding long transients.
- Focusing on the development of 3D instabilities from a 2D base state.
Note: The binary file format is described in auxiliar_input.h
.
Example:
An example of initialization of 3D field using 2D results is available here.
initial_conditions_dimonte_fft2()
Location: initial_conditions_dimonte_fft2.h
Description:
This function uses a 2D Fourier Transform to generate a perturbation field with an annular spectrum, as described in Dimonte et al. (2004). This method is particularly useful for simulating turbulent mixing layers, such as those observed in Rayleigh-Taylor or Richtmyer-Meshkov instabilities. This approach ensures consistent initial conditions for studying the growth of instabilities and mixing in multi-dimensional simulations.
Example:
Examples are available below:
- Test #1: a 2D scalar field.
- Test #2: a 2D scalar field.
- Test #3: a 3D perturbed interface.
- Test #4: a 2D perturbed interface.
input_matrix()
Location: auxiliar_input.h
Description: Reads a binary file generated by output_matrix()
and loads it into a user-specified field. For example, to read a square
field of size L0 defined on a regular Cartesian grid
with N points, starting from (X0,
Y0), stored in a file example.bin
, and
load it into a scalar field.
Example:
An example of generating arbitrary initial conditions using MATLAB is available here.
vortex_filament
and Related Functions
Location: filaments.h
and draw_filaments.h
Description: Provides a comprehensive framework for representing curved vortex filaments in three-dimensional space. This implementation follows the mathematical development of Callegari and Ting (1978) and includes:
- Geometric representation: Uses Frenet-Serret frames with tangent (\vec{T}), normal (\vec{N}), and binormal (\vec{B}) vectors to describe curved vortex filaments.
- Local coordinate system: Projects points onto the filament’s local frame using curvilinear orthogonal coordinates (\rho, \theta, s).
- Batchelor vortex model: Computes velocity and vorticity fields for vortex cores with finite thickness, including curvature corrections.
Key Functions:
allocate_vortex_filament_members()
/free_vortex_filament_members()
: Memory management for filament structuresget_local_coordinates()
: Projects points onto the Frenet-Serret framecalculate_vortex_flow()
: Computes velocity and vorticity fields with curvature correctionsinitialize_filaments()
: Macro for easy filament initialization
Examples: Examples demonstrating various vortex
filament configurations are available in the tests_filaments/
directory.
References
[dimonte2004] |
Guy Dimonte, D. L. Youngs, A. Dimits, S. Weber, M. Marinak, S. Wunsch, C. Garasi, A. Robinson, M. J. Andrews, P. Ramaprabhu, A. C. Calder, B. Fryxell, J. Biello, L. Dursi, P. MacNeice, K. Olson, P. Ricker, R. Rosner, F. Timmes, H. Tufo, Y.-N. Young, and M. Zingale. A comparative study of the turbulent rayleigh–taylor instability using high-resolution three-dimensional numerical simulations: The alpha-group collaboration. Physics of Fluids, 16(5):1668–1693, 05 2004. [ DOI ] |
[callegari1978] |
AJ Callegari and Lu Ting. Motion of a curved vortex filament with decaying vortical core and axial velocity. SIAM Journal on Applied Mathematics, 35(1):148–175, 1978. |