Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out PTE convergence issues #390

Open
jhp-lanl opened this issue Jul 16, 2024 · 0 comments
Open

Figure out PTE convergence issues #390

jhp-lanl opened this issue Jul 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jhp-lanl
Copy link
Collaborator

In #383 I added two tests where the PTE solver hadn't been converging. I fixed the issue with the first test, but I have yet to fix the second test.

This is the second test that doesn't converge (I believe with underflow in the temperature):

  GIVEN("Two equations of state") {
    // Set up the three EOS
    constexpr int num_eos = 2;
    std::array<EOS, num_eos> eos_arr;
    // Reference state
    constexpr Real P0 = 1.0e6; // 1 bar
    constexpr Real T0 = 296;   // K
    // Ideal gas air
    constexpr Real rho0_air = 1e-03; // g/cc
    constexpr Real Gruneisen_air = 0.4;
    constexpr Real CV_air = P0 / rho0_air / (Gruneisen_air * T0);
    eos_arr[0] = IdealGas(Gruneisen_air, CV_air);
    // Spiner copper EOS
    constexpr int Cu_matid = 3337;
    const std::string eos_file = "../materials.sp5";
    eos_arr[1] = SpinerEOSDependsRhoT(eos_file, Cu_matid);

    GIVEN("A state that would cause a negative temperature in the PTE solver") {
      // Define the state
      constexpr Real spvol_bulk = 4.010467628234189e-01;
      constexpr Real sie_bulk = 3.290180957185173e+07;
      const std::array<const Real, num_eos> mass_frac = {0.000312273191678158,
                                                         0.999687726808322};

      THEN("The PTE solver should converge") {
        EOS *v_EOS = copy_eos_arr_to_device(num_eos, eos_arr);
        const bool pte_converged =
            run_PTE_from_state(num_eos, v_EOS, spvol_bulk, sie_bulk, mass_frac);
        // TODO: make this test converge
        // CHECK(pte_converged);
        finalize_eos_arr(num_eos, v_EOS);
      }
    }
  }
@jhp-lanl jhp-lanl added bug Something isn't working good first issue Good for newcomers labels Jul 16, 2024
@jhp-lanl jhp-lanl self-assigned this Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant