Exawind / nalu-wind

Solver for wind farm simulations targeting exascale computational platforms
https://nalu-wind.readthedocs.io
Other
123 stars 83 forks source link

More 'uncleared modified_on_device' for temperature field #1191

Closed ndevelder closed 5 months ago

ndevelder commented 1 year ago

Hi All,

I think we've seen a few of these, but we're running a precursor with a temperature field and boundary i/o and getting this on setup/initialization...i.e. no time steps have run. What are the steps we can take to figure out where the device/host syncs need to happen?

Thanks!

terminate called after throwing an instance of 'std::logic_error'
terminate called after throwing an instance of 'std::logic_error'
terminate called after throwing an instance of 'std::logic_error'
  what():  Requirement( m_modifiedOnDevice == false ) FAILED
Error occurred at: stk_mesh/stk_mesh/base/FieldBase.cpp:392
 0# stk::output_stacktrace(std::ostream&) in /projects/wind/spack-manager/spack/opt/spack/linux-rhel7-sandybridge/gcc-10.3.0/trilinos-13.4.0.2022.10.27-z6tbycwu5qbrffco5u4q4uqm2r4s4hbq/lib/libstk_util_util.so.13
 1# stk::mesh::FieldBase::modify_on_host() const in /projects/wind/spack-manager/spack/opt/spack/linux-rhel7-sandybridge/gcc-10.3.0/trilinos-13.4.0.2022.10.27-z6tbycwu5qbrffco5u4q4uqm2r4s4hbq/lib/libstk_mesh_base.so.13
 2# sierra::nalu::Realm::populate_restart(double&, int&) in /projects/wind/spack-manager/spack/opt/spack/linux-rhel7-sandybridge/gcc-10.3.0/nalu-wind-git.e86c78894785bbf47c37fb09224262f2790c2d07=master-e7ktwozuzfgmqv6ag4sesrihtz47dclc/lib/libnalu.so
 3# sierra::nalu::TimeIntegrator::prepare_for_time_integration() in /projects/wind/spack-manager/spack/opt/spack/linux-rhel7-sandybridge/gcc-10.3.0/nalu-wind-git.e86c78894785bbf47c37fb09224262f2790c2d07=master-e7ktwozuzfgmqv6ag4sesrihtz47dclc/lib/libnalu.so
 4# sierra::nalu::TimeIntegrator::integrate_realm() in /projects/wind/spack-manager/spack/opt/spack/linux-rhel7-sandybridge/gcc-10.3.0/nalu-wind-git.e86c78894785bbf47c37fb09224262f2790c2d07=master-e7ktwozuzfgmqv6ag4sesrihtz47dclc/lib/libnalu.so
 5# 0x000000000040CF49 in naluX
 6# __libc_start_main in /usr/lib64/libc.so.6
 7# 0x000000000040DC8E in naluX

Error: Modify on host called for Field: temperature but it has an uncleared modified_on_device
ndevelder commented 1 year ago

And just a little more detail about the case:

ndevelder commented 1 year ago

Input file here:

# -*- mode: yaml -*-
#
# Nalu Preprocessing utility
#
# Generate a temperature profile with capping inversion for use with ablNeutralEdge case
#

nalu_abl_mesh:
  output_db: mesh_abl.exo
  spec_type: bounding_box
  fluid_part_name: fluid_part
  vertices:
  - [0.0, 0.0, 0.0]
  - [500.0, 500.0, 1000.0]
  mesh_dimensions: [100, 100, 200]
  xmin_boundary_name: west
  xmax_boundary_name: east
  ymin_boundary_name: south
  ymax_boundary_name: north
  zmin_boundary_name: lower
  zmax_boundary_name: upper

# Mandatory section for Nalu preprocessing
nalu_preprocess:
  # Name of the input exodus database
  input_db: mesh_abl.exo
  # Name of the output exodus database
  output_db: mesh_abl_output.exo

  # Nalu preprocessor expects a list of tasks to be performed on the mesh and
  # field data structures
  tasks:
  - init_abl_fields

  init_abl_fields:

    # Fluid part is the interior mesh block(s) in the mesh. The default block is
    # `fluid` if the mesh was generated using `abl_mesh` utility.
    #
    # Use `ncdump -v eb_names <exodus_file>` to determine the mesh blocks
    #
    fluid_parts: [fluid_part]

    temperature:
      heights: [0,       650.0,   750.0,   1000.0]
      values:  [305.803, 305.803, 313.803, 313.9905]
      # Note that this temperature gradient above z=1500m also goes in the BC:
      #   normal_temperature_gradient: 0.00075

      # Optional section to add random perturbations to temperature field
      perturbations:
        amplitude: 0.8 # in Kelvin
        cutoff_height: 800.0 # Perturbations below capping inversion
        skip_periodic_parts: [east, west, north, south]

    velocity:
      heights:
      - 0
      - 500.0
      values:
      - [6.25232, 0.0, 0.0]
      - [6.25232, 0.0, 0.0]
      perturbations:
        reference_height: 50.0   # Reference height for damping
        amplitude: [1.0, 1.0]    # Perturbation amplitudes in Ux and Uy
        periods: [4.0, 4.0]      # Num. periods in x and y directions

Simulations:
- name: sim1
  time_integrator: ti_1
  optimizer: opt1

# Specify the linear system solvers.
linear_solvers:

  # solver for scalar equations
- name: solve_scalar
  type: tpetra
  method: gmres
  preconditioner: sgs
  tolerance: 1e-6
  max_iterations: 75
  kspace: 75
  output_level: 0

  # solver for the pressure Poisson equation
- name: solve_cont
  type: tpetra
  method: gmres
  preconditioner: muelu
  tolerance: 1e-6
  max_iterations: 75
  kspace: 75
  output_level: 0
  recompute_preconditioner: no
  muelu_xml_file_name: ./milestone.xml

# Specify the differnt physics realms.  Here, we just have one for the fluid.
realms:

  # The fluid realm that uses the 5 km x 5 km x 1 km atmospheric LES mesh.
- name: fluidRealm
  mesh: /nscratch/kbrown1/Advanced_Control/Nalu/SmallDomain/Mesh/mynewmesh_turbine.exo
  automatic_decomposition_type: rcb #rcb
  #mesh: restart_data/precursor.rst
  #automatic_decomposition_type: None
  use_edges: yes

    # This defines the equations to be solved: momentum, pressure, static enthalpy,
    # and subgrid-scale turbulent kinetic energy.  The equation system will be iterated
    # a maximum of 4 outer iterations.
  equation_systems:
    name: theEqSys
    max_iterations: 2

      # This defines which solver to use for each equation set.  See the
      # "linear_solvers" block.  All use the scalar solver, except pressure.
    solver_system_specification:
      velocity: solve_scalar
      pressure: solve_cont
      enthalpy: solve_scalar
      turbulent_ke: solve_scalar

      # This defines the equation systems, maximum number of inner iterations,
      # and scaled nonlinear residual tolerance.
    systems:

    - LowMachEOM:
        name: myLowMach
        max_iterations: 1
        convergence_tolerance: 1.0e-5

    - Enthalpy:
        name: myEnth
        max_iterations: 1
        convergence_tolerance: 1.0e-5

    - TurbKineticEnergy:
        name: myTke
        max_iterations: 1
        convergence_tolerance: 1.0e-5

    # Specify the properties of the fluid, in this case air.
  material_properties:

    target_name: [fluid_part, fluid_part.pyramid_5._urpconv, fluid_part.tetrahedron_4._urpconv]

    constant_specification:
      universal_gas_constant: 8314.4621
      reference_pressure: 101243.60 # rho_ref*(R/mw)*T_ref => 1.15357*287*305.803

    reference_quantities:
    - species_name: Air
      mw: 29.0
      mass_fraction: 1.0

    specifications:

        # Density could be computed such that P_ref = rho_ref*(R/mw)*T_ref
    - name: density
      type: constant
      value: 1.15357

    - name: viscosity
      type: constant
      value: 1.598e-05  # viscosity at 303K

    - name: specific_heat
      type: constant
      value: 1007.0

    # The initial conditions are that pressure is uniformly 0 Pa and velocity
    # is 8 m/s from 245 degrees (southwest).  Initial temperature is not
    # specified here because later it is specified as read in from file.
    # Also, perturbations are applied near the surface to initiate turbulence.
  initial_conditions: # IGNORE this section - will be overwritten
  - constant: ic_1
    target_name: [fluid_part, fluid_part.pyramid_5._urpconv, fluid_part.tetrahedron_4._urpconv]
        # These are dummy variables to be overwritten by nalu_wind_utils
    value:
      pressure: 0.0
      velocity: [6.25232, 0.0, 0.0]

    # Boundary conditions are periodic on the north, south, east, and west
    # sides.  The lower boundary condition is a wall that uses an atmospheric
    # rough wall shear stress model.  The upper boundary is a stress free
    # rigid lid applied through symmetry, but the temperature is set to hold
    # a specified boundary normal gradient that matches the stable layer
    # immediately below.
  boundary_conditions: # CHANGE_THIS_1
  - inflow_boundary_condition: bc_inflow_west  # THIS ONE IS THE ONE TO USE
    target_name: west
    inflow_user_data:
      velocity:
      - 6.25232
      - 0.0
      - 0.0
      temperature: 305.803
      external_data: yes

  - inflow_boundary_condition: bc_inflow_south  # THIS ONE IS THE ONE TO USE
    target_name: south
    inflow_user_data:
      velocity:
      - 6.25232
      - 0.0
      - 0.0
      temperature: 305.803
      external_data: yes

  - inflow_boundary_condition: bc_inflow_north  # THIS ONE IS THE ONE TO USE
    target_name: north
    inflow_user_data:
      velocity:
      - 6.25232
      - 0.0
      - 0.0
      temperature: 305.803
      external_data: yes

  - open_boundary_condition: bc_open_east
    target_name: east
    open_user_data:
      velocity:
      - 6.25232
      - 0.0
      - 0.0
      temperature: 305.803
      pressure: 0.0

  - abltop_boundary_condition: bc_upper
    target_name: upper
    abltop_user_data:
      normal_temperature_gradient: 0.00075

  - wall_boundary_condition: bc_lower
    target_name: lower
    # This is the new BC
    wall_user_data:
      velocity: [0.0,0.0,0.0]
      abl_wall_function:
    # Put in guesses for the applied temperature flux.
    # From Mithu's measurements, kinematic heat flux is
    #    <w'Theta'> = 0.11443 K*m/s                       
    # The equivalent heat flux is                    
    #    q = rho*Cp*<w'Theta'> = 1.17*1007*0.106706 = 134.8203 W/m^2       
        surface_heating_table: # ITERATE on this
          #   Time     Tflux    T   weight (1=Tflux specified, 2=T specified)
          - [     0.0, 0.000, 305.803, 2.0]
          - [ 21600.0, 0.000, 304.903, 2.0]
          - [999999.9, 0.000, 304.903, 2.0]
        reference_temperature: 305.803  # keep this between start and end T
        roughness_height: 0.0015   # ITERATE on this
        kappa: 0.4
        beta_m: 5.0
        beta_h: 5.0
        gamma_m: 16.0
        gamma_h: 16.0
        gravity_vector_component: 3
        #monin_obukhov_averaging_type: planar
        fluctuation_model: Moeng

  solution_options:
    name: myOptions
    turbulence_model: ksgs
    interp_rhou_together_for_mdot: yes
    activate_open_mdot_correction: yes
    explicitly_zero_open_pressure_gradient: yes

#      # Pressure is not fixed anywhere on the boundaries, so set it at
#      # the node closest to the specified location.
#    fix_pressure_at_node:
#      value: 0.0
#      node_lookup_type: spatial_location
#      location: [100.0, 100.0, 1.0]
#      search_target_part: [fluid_part, fluid_part.pyramid_5._urpconv, fluid_part.tetrahedron_4._urpconv]
#      search_method: stk_kdtree

    options:

        # Model constants for the 1-eq k SGS model.
    - turbulence_model_constants:
        kappa: 0.4
        cEps: 0.93
        cmuEps: 0.0673

    - laminar_prandtl:
        enthalpy: 0.7

        # Turbulent Prandtl number is 1/3 following Moeng (1984).
    - turbulent_prandtl:
        enthalpy: 0.3333

        # SGS viscosity is divided by Schmidt number in the k SGS diffusion
        # term.  In Moeng (1984), SGS viscosity is multiplied by 2, hence
        # we divide by 1/2
    - turbulent_schmidt:
        turbulent_ke: 0.5

        # The momentum source terms are a Boussinesq bouyancy term,
        # Coriolis from Earth's rotation, and a source term to drive
        # the planar-averaged wind at a certain height to a certain
        # speed.
    - source_terms:
        momentum:
        - actuator
        - buoyancy_boussinesq
        - EarthCoriolis
        #- abl_forcing
        turbulent_ke:
        - rodi

    - user_constants:
        reference_density: 1.15357 # SET
        reference_temperature: 305.803 # SET
        gravity: [0.0, 0.0, -9.81]
        thermal_expansion_coefficient: 0.00330033003300330033  # 1/reference_temperature
        east_vector: [1.0, 0.0, 0.0]
        north_vector: [0.0, 1.0, 0.0]
        # For thunder ranch layout, see
        # https://gitlab.sandia.gov/lcheung/awaken/-/blob/master/ThunderRanchCoords/ThunderRanchCoordinates.ipynb
        latitude:  36.57236455833334 
        earth_angular_velocity: 7.2921159e-5

    - limiter:
        pressure: no
        velocity: no
        enthalpy: yes

    - peclet_function_form:
        velocity: tanh
        enthalpy: tanh
        turbulent_ke: tanh

    - peclet_function_tanh_transition:
        velocity: 50000.0
        enthalpy: 2.0
        turbulent_ke: 2.0

    - peclet_function_tanh_width:
        velocity: 200.0
        enthalpy: 1.0
        turbulent_ke: 1.0

       # This means that the initial temperature is read in
       # from the Exodus mesh/field file.
    - input_variables_from_file:
        velocity: velocity
        temperature: temperature

  actuator:
    type: ActLineFASTNGP
    search_method: boost_rtree  #stk_kdtree
    search_target_part: [fluid_part, fluid_part.pyramid_5._urpconv, fluid_part.tetrahedron_4._urpconv]

    n_turbines_glob: 2
    dry_run: false
    debug: false
    simStart: init
    t_start: 0.0
    t_max: 100000.0
    dt_fast: 0.005
    n_every_checkpoint: 4000

    Turbine0:
      fllt_correction: true 
      num_force_pts_blade: 100
      num_force_pts_tower: 20
      nacelle_cd: 1.0
      nacelle_area: 8.0
      air_density: 1.15357
      epsilon_min:
      - 2.5
      - 2.5
      - 2.5
      epsilon_chord: [ 0.25, 0.25, 0.25 ]
      turbine_base_pos: [1050.0, 375.0, 0.0]
      turbine_hub_pos: [1050.0, 375.0, 87.617700]
      restart_filename: blah
      fast_input_filename: OpenFAST1/NREL-2p8-127.fst
      turb_id: 1
      turbine_name: machine_one

    Turbine1:
      fllt_correction: true 
      num_force_pts_blade: 100
      num_force_pts_tower: 20
      nacelle_cd: 1.0
      nacelle_area: 8.0
      air_density: 1.15357
      epsilon_min:
      - 2.5
      - 2.5
      - 2.5
      epsilon_chord: [ 0.25, 0.25, 0.25 ]
      turbine_base_pos: [1939.0, 375.0, 0.0]
      turbine_hub_pos: [1939.0, 375.0, 87.617700]
      restart_filename: blah2
      fast_input_filename: OpenFAST2/NREL-2p8-127.fst
      turb_id: 2
      turbine_name: machine_two

  output:
    output_data_base_name: output/Stable2.exo
    output_frequency: 1000
    output_node_set: no
    output_variables:
    - velocity
    #- pressure
    #- enthalpy
    - temperature
    - turbulent_ke

  data_probes:  
    output_format: text 
    #exodus_name: probes2.exo
    output_frequency: 25
    search_method: stk_kdtree
    search_tolerance: 1.0e-5 #1.0e-3
    search_expansion_factor: 2.0
    gzip_level: 1             # Optional, Default: 0
    write_coords: false       # Optional, Default: true
    time_performance: true

    specifications:
    - name: probe_surface
      from_target_part: [fluid_part, fluid_part.pyramid_5._urpconv, fluid_part.tetrahedron_4._urpconv]
      plane_specifications:        
        - name: sliceData/HHplane/HHplane_00.00D
          corner_coordinates:  [0, 0, 87.6177]
          edge1_vector:    [3000, 0, 0]
          edge2_vector:    [0, 750, 0]
          edge1_numPoints: 601
          edge2_numPoints: 601

        - name: sliceData/YZslice/YZslice_-5.00D
          corner_coordinates:  [415.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_-2.50D
          corner_coordinates:  [732.500000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_00.50D
          corner_coordinates:  [1113.500000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_01.00D
          corner_coordinates:  [1177.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_01.50D
          corner_coordinates:  [1240.500000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_02.00D
          corner_coordinates:  [1304.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_02.50D
          corner_coordinates:  [1367.500000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_03.00D
          corner_coordinates:  [1431.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_03.50D
          corner_coordinates:  [1494.500000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_04.00D
          corner_coordinates:  [1558.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_05.00D
          corner_coordinates:  [1685.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_06.00D
          corner_coordinates:  [1812.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_07.00D
          corner_coordinates:  [1939.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_07.50D
          corner_coordinates:  [2002.500000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_08.00D
          corner_coordinates:  [2066.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_08.50D
          corner_coordinates:  [2129.500000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_09.00D
          corner_coordinates:  [2193.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_09.50D
          corner_coordinates:  [2256.500000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_10.00D
          corner_coordinates:  [2320.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_10.50D
          corner_coordinates:  [2383.500000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_11.00D
          corner_coordinates:  [2447.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_12.00D
          corner_coordinates:  [2574.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_13.00D
          corner_coordinates:  [2701.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/YZslice/YZslice_14.00D
          corner_coordinates:  [2828.000000, 121.000000, 0.000000]
          edge1_vector:    [0,  508.000000, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 407
          edge2_numPoints: 274

        - name: sliceData/XZslice/XZslice_velocity_-63.50D
          corner_coordinates:  [0.000000, 311.500000, 0.000000]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 2401
          edge2_numPoints: 547
          only_output_field: velocity

        - name: sliceData/XZslice/XZslice_pressure_-63.50D
          corner_coordinates:  [0.000000, 311.500000, 0.000000]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 2401
          edge2_numPoints: 547
          only_output_field: pressure

        - name: sliceData/XZslice/XZslice_temperature_-63.50D
          corner_coordinates:  [0.000000, 311.500000, 0.000000]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 2401
          edge2_numPoints: 547
          only_output_field: temperature

        - name: sliceData/XZslice/XZslice_velocity_00.00D
          corner_coordinates:  [0.000000, 375.000000, 0.000000]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 2401
          edge2_numPoints: 547
          only_output_field: velocity

        - name: sliceData/XZslice/XZslice_pressure_00.00D
          corner_coordinates:  [0.000000, 375.000000, 0.000000]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 2401
          edge2_numPoints: 547
          only_output_field: pressure

        - name: sliceData/XZslice/XZslice_temperature_00.00D
          corner_coordinates:  [0.000000, 375.000000, 0.000000]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 2401
          edge2_numPoints: 547
          only_output_field: temperature

        - name: sliceData/XZslice/XZslice_velocity_63.50D
          corner_coordinates:  [0.000000, 438.500000, 0.000000]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 2401
          edge2_numPoints: 547
          only_output_field: velocity

        - name: sliceData/XZslice/XZslice_pressure_63.50D
          corner_coordinates:  [0.000000, 438.500000, 0.000000]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 2401
          edge2_numPoints: 547
          only_output_field: pressure

        - name: sliceData/XZslice/XZslice_temperature_63.50D
          corner_coordinates:  [0.000000, 438.500000, 0.000000]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   0, 341.617700]
          edge1_numPoints: 2401
          edge2_numPoints: 547
          only_output_field: temperature

        - name: sliceData/XYslice/XYslice_velocity_-63.50D
          corner_coordinates:  [0.000000, 121.000000, 24.117700]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   508.000000, 0]
          edge1_numPoints: 2401
          edge2_numPoints: 813
          only_output_field: velocity

        - name: sliceData/XYslice/XYslice_pressure_-63.50D
          corner_coordinates:  [0.000000, 121.000000, 24.117700]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   508.000000, 0]
          edge1_numPoints: 2401
          edge2_numPoints: 813
          only_output_field: pressure

        - name: sliceData/XYslice/XYslice_temperature_-63.50D
          corner_coordinates:  [0.000000, 121.000000, 24.117700]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   508.000000, 0]
          edge1_numPoints: 2401
          edge2_numPoints: 813
          only_output_field: temperature

        - name: sliceData/XYslice/XYslice_velocity_00.00D
          corner_coordinates:  [0.000000, 121.000000, 87.617700]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   508.000000, 0]
          edge1_numPoints: 2401
          edge2_numPoints: 813
          only_output_field: velocity

        - name: sliceData/XYslice/XYslice_pressure_00.00D
          corner_coordinates:  [0.000000, 121.000000, 87.617700]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   508.000000, 0]
          edge1_numPoints: 2401
          edge2_numPoints: 813
          only_output_field: pressure

        - name: sliceData/XYslice/XYslice_temperature_00.00D
          corner_coordinates:  [0.000000, 121.000000, 87.617700]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   508.000000, 0]
          edge1_numPoints: 2401
          edge2_numPoints: 813
          only_output_field: temperature

        - name: sliceData/XYslice/XYslice_velocity_63.50D
          corner_coordinates:  [0.000000, 121.000000, 151.117700]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   508.000000, 0]
          edge1_numPoints: 2401
          edge2_numPoints: 813
          only_output_field: velocity

        - name: sliceData/XYslice/XYslice_pressure_63.50D
          corner_coordinates:  [0.000000, 121.000000, 151.117700]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   508.000000, 0]
          edge1_numPoints: 2401
          edge2_numPoints: 813
          only_output_field: pressure

        - name: sliceData/XYslice/XYslice_temperature_63.50D
          corner_coordinates:  [0.000000, 121.000000, 151.117700]
          edge1_vector:    [3000.000000,  0, 0]
          edge2_vector:    [0,   508.000000, 0]
          edge1_numPoints: 2401
          edge2_numPoints: 813
          only_output_field: temperature

      line_of_site_specifications:          
        - name: Probes/Probe_Met1 
          number_of_points: 49
          tip_coordinates:  [732.5, 375.0, 10.0]
          tail_coordinates:  [732.5, 375.0, 165.0]

        - name: Probes/Probe_Met2 
          number_of_points: 49
          tip_coordinates:  [1621.5, 375.0, 10.0]
          tail_coordinates:  [1621.5, 375.0, 165.0]

      output_variables:
        - field_name: velocity
          field_size: 3
        - field_name: temperature
          field_size: 1
        - field_name: pressure
          field_size: 1

    # Compute spatial averages of velocity and temperature at all height levels
    # available on the ABL mesh. This is used for post-processing as well as
    # determining the ABL forcing necessary to drive the wind to a certain
    # speed/direction at different heights. See `abl_forcing` section below for
    # details of the driving wind forcing.
  boundary_layer_statistics:
    target_name: [fluid_part, fluid_part.pyramid_5._urpconv, fluid_part.tetrahedron_4._urpconv]
    stats_output_file: abl_statistics.nc
    compute_temperature_statistics: yes
    output_frequency: 10000
    time_hist_output_frequency: 1

  abl_forcing:
    output_format: abl_%s_sources.dat
    momentum:
      type: computed
      relaxation_factor: 1.0
      heights:
      - 91.0
      velocity_x:
      - - 0.0
        - 6.25232
      - - 1000000000.0
        - 6.25232
      velocity_y:
      - - 0.0
        - 0.0
      - - 1000000000.0
        - 0.0
      velocity_z:
      - - 0.0
        - 0.0
      - - 1000000000.0
        - 0.0
  restart:
    restart_data_base_name: ./restart_data/precursor.rst
    restart_frequency: 1000
    restart_start: 0
    restart_time: 0.0

- name: ioRealm
  mesh: /nscratch/kbrown1/Late-Start_LDRD/Nalu-Wind/Runs/Precursors/Stable2/FullRun/boundaryData/boundary_data.exo
  type: external_field_provider

  field_registration:
    specifications:

    - field_name: velocity_bc
      target_name: &id001 [north, south, west]
      field_size: 3
      field_type: node_rank

    - field_name: cont_velocity_bc
      target_name: *id001
      field_size: 3
      field_type: node_rank

    - field_name: temperature_bc
      target_name: *id001
      field_size: 1
      field_type: node_rank

    - field_name: turbulent_ke_bc
      target_name: *id001
      field_size: 1
      field_type: node_rank

  solution_options:
    name: myOptions
    input_variables_interpolate_in_time: yes
    input_variables_from_file_restoration_time: 16250.0

    options:
      - input_variables_from_file:
          velocity_bc: velocity_bc
          cont_velocity_bc: cont_velocity_bc
          temperature_bc: temperature_bc
          turbulent_ke_bc: turbulent_ke_bc

- name: ioRealmIC  # CHANGE_THIS_4
  mesh: /nscratch/kbrown1/Late-Start_LDRD/Nalu-Wind/Runs/Precursors/Stable2/FullRun/restart_data/precursor.rst
  type: initialization

  field_registration:
    specifications:

      - field_name: velocity
        target_name: &allpartsIC [fluid_part, fluid_part.pyramid_5._urpconv, fluid_part.tetrahedron_4._urpconv] 
        field_size: 3
        field_type: node_rank

      - field_name: enthalpy
        target_name: *allpartsIC
        field_size: 1
        field_type: node_rank

      - field_name: pressure
        target_name: *allpartsIC 
        field_size: 1
        field_type: node_rank

      - field_name: turbulent_ke
        target_name: *allpartsIC
        field_size: 1
        field_type: node_rank

      - field_name: temperature
        target_name: *allpartsIC 
        field_size: 1
        field_type: node_rank

  solution_options:
    name: myOptionsIC
    input_variables_interpolate_in_time: yes
    input_variables_from_file_restoration_time: 16250  #CHECK

    options:
      - input_variables_from_file:
          velocity: velocity
          temperature: temperature
          enthalpy: enthalpy
          turbulent_ke: turbulent_ke    
          pressure: pressure

transfers:
### Fluid to ....
- name: xfer_io_fluids
  type: geometric
  realm_pair: [ioRealmIC, fluidRealm]
  from_target_name: *allpartsIC 
  to_target_name:   [fluid_part, fluid_part.pyramid_5._urpconv, fluid_part.tetrahedron_4._urpconv] 
  objective: initialization
  search_tolerance: 5.0e-3
  transfer_variables:
    - [velocity, velocity]
    - [pressure, pressure]
    - [enthalpy, enthalpy]
    - [turbulent_ke, turbulent_ke]
    - [temperature, temperature]

- name: south
  type: geometric
  realm_pair: [ioRealm, fluidRealm]
  mesh_part_pair: [south, south]
  objective: external_data
  search_tolerance: 5.0e-3
  transfer_variables:
    - [velocity_bc, velocity]
    - [velocity_bc, velocity_bc]
    - [temperature_bc, temperature]
    - [temperature_bc, temperature_bc]
    - [turbulent_ke_bc, tke_bc]
    - [turbulent_ke_bc, turbulent_ke]

- name: west
  type: geometric
  realm_pair: [ioRealm, fluidRealm]
  mesh_part_pair: [west, west]
  objective: external_data
  search_tolerance: 5.0e-3
  transfer_variables:
    - [velocity_bc, velocity]
    - [velocity_bc, velocity_bc]
    - [temperature_bc, temperature]
    - [temperature_bc, temperature_bc]
    - [turbulent_ke_bc, tke_bc]
    - [turbulent_ke_bc, turbulent_ke]

- name: north
  type: geometric
  realm_pair: [ioRealm, fluidRealm]
  mesh_part_pair: [north, north]
  objective: external_data
  search_tolerance: 5.0e-3
  transfer_variables:
    - [velocity_bc, velocity]
    - [velocity_bc, velocity_bc]
    - [temperature_bc, temperature]
    - [temperature_bc, temperature_bc]
    - [turbulent_ke_bc, tke_bc]
    - [turbulent_ke_bc, turbulent_ke]

Time_Integrators:
- StandardTimeIntegrator:
    name: ti_1
    start_time: 16250.0
    termination_step_count: 65000
    time_step: 0.02  # at 6.5 m/s, rpm ~= 8, tip speed ~=53 m/s, so maximum timestep for 1 cell per timestep of tip movement ~= 1*1.25 m / 53 m/s = 0.023 s ,  quarter-degree per timestep: 0.25/360/(8rpm/60)=0.0052 s
    time_stepping_type: fixed
    time_step_count: 0
    second_order_accuracy: yes

    realms:
    - fluidRealm
    - ioRealmIC
    - ioRealm
ndevelder commented 1 year ago

Quick update, I think I've narrowed this down to the either boundary i/o or the restart initial condition. The case works in steady flow with all the other features turned on and the i/o realms removed. So maybe there's a device call somewhere in the i/o code that doesn't have a copytohost?

alanw0 commented 1 year ago

@ndevelder sorry for the delayed response! We'll see if we can get someone here to reproduce this and see what's going on.

ddement commented 1 year ago

@ndevelder We're taking a look at this problem now. Is there a way for us to get access to the mesh files used for the input you posted? We have a build ready that should let us reproduce it.

ndevelder commented 1 year ago

Hi @ddement! If you've got the wg-WindHFM group perm on the hpc machines, you should be able to read/copy the files referenced in the above input? The main mesh is about 14GB and not sure about the i/o files. I could also copy them somewhere if you don't have access....where would you be running this?

ddement commented 1 year ago

@ndevelder The plan was just to run it on the ASCICGPU machines, but if you think it is too big for that, we can set up elsewhere pretty easily. It may be more ergonomic to debug a smaller problem, but I know it might be hard to put together a reproducer.

I'm not a member of that group. I do have wg-wind-dev, or we can work on another way for me to get my hands on them.