From 0eaa85196edca7dcb054337f48cfc158e95776c0 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 3 Jul 2026 10:40:57 +0800 Subject: [PATCH] Add Gas material EOS table --- src/gas/sph_gas.f90 | 317 ++++++++++++++++--- src/input/sph_input_reader.f90 | 5 +- tests/data/gas_duplicate_eos_031.inp | 14 + tests/data/gas_eos_on_water_material_031.inp | 13 + todo.md | 40 +-- 5 files changed, 332 insertions(+), 57 deletions(-) create mode 100644 tests/data/gas_duplicate_eos_031.inp create mode 100644 tests/data/gas_eos_on_water_material_031.inp diff --git a/src/gas/sph_gas.f90 b/src/gas/sph_gas.f90 index e8fd17c..89b4e11 100644 --- a/src/gas/sph_gas.f90 +++ b/src/gas/sph_gas.f90 @@ -2,8 +2,9 @@ module sph_gas use sph_precision, only: rk, SPH_NDIM use sph_error, only: SPH_SUCCESS, SPH_ERROR_ARGUMENT, SPH_ERROR_INPUT, & sph_error_set - use sph_database, only: npart, particle_phase, particle_status, material_id, & - material_count, material_name, material_type, material_density, & + use sph_database, only: npart, SPH_MAX_MATERIALS, particle_phase, & + particle_status, material_id, material_count, material_name, & + material_type, material_density, & section_count, section_material_id, x, v, a, mass, rho, volume, & pressure, internal_energy, temperature, h, drho_dt, acc_pressure, & acc_body, neighbor_count, neighbor_offset, neighbor_list, & @@ -42,6 +43,26 @@ module sph_gas real(rk) :: gas_default_mass = 1.0_rk real(rk) :: gas_default_volume = 1.0_rk real(rk) :: gas_body_force(SPH_NDIM) = 0.0_rk + integer :: gas_material_count = 0 + integer :: gas_material_ids(SPH_MAX_MATERIALS) = 0 + character(len=64) :: gas_material_names(SPH_MAX_MATERIALS) = ' ' + logical :: gas_material_eos_defined(SPH_MAX_MATERIALS) = .false. + integer :: gas_material_eos_type(SPH_MAX_MATERIALS) = GAS_EOS_NONE + real(rk) :: gas_material_density_default(SPH_MAX_MATERIALS) = 0.0_rk + real(rk) :: gas_material_energy_default(SPH_MAX_MATERIALS) = 0.0_rk + real(rk) :: gas_material_temperature_default(SPH_MAX_MATERIALS) = 293.15_rk + real(rk) :: gas_material_rho0(SPH_MAX_MATERIALS) = 1.0_rk + real(rk) :: gas_material_gamma(SPH_MAX_MATERIALS) = 1.4_rk + real(rk) :: gas_material_p0(SPH_MAX_MATERIALS) = 0.0_rk + real(rk) :: gas_material_jwl_a(SPH_MAX_MATERIALS) = 0.0_rk + real(rk) :: gas_material_jwl_b(SPH_MAX_MATERIALS) = 0.0_rk + real(rk) :: gas_material_jwl_r1(SPH_MAX_MATERIALS) = 0.0_rk + real(rk) :: gas_material_jwl_r2(SPH_MAX_MATERIALS) = 0.0_rk + real(rk) :: gas_material_jwl_omega(SPH_MAX_MATERIALS) = 0.0_rk + real(rk) :: gas_material_pinf(SPH_MAX_MATERIALS) = 0.0_rk + real(rk) :: gas_material_default_h(SPH_MAX_MATERIALS) = 1.0_rk + real(rk) :: gas_material_default_mass(SPH_MAX_MATERIALS) = 1.0_rk + real(rk) :: gas_material_default_volume(SPH_MAX_MATERIALS) = 1.0_rk contains @@ -77,6 +98,26 @@ contains gas_default_mass = 1.0_rk gas_default_volume = 1.0_rk gas_body_force = 0.0_rk + gas_material_count = 0 + gas_material_ids = 0 + gas_material_names = ' ' + gas_material_eos_defined = .false. + gas_material_eos_type = GAS_EOS_NONE + gas_material_density_default = 0.0_rk + gas_material_energy_default = 0.0_rk + gas_material_temperature_default = 293.15_rk + gas_material_rho0 = 1.0_rk + gas_material_gamma = 1.4_rk + gas_material_p0 = 0.0_rk + gas_material_jwl_a = 0.0_rk + gas_material_jwl_b = 0.0_rk + gas_material_jwl_r1 = 0.0_rk + gas_material_jwl_r2 = 0.0_rk + gas_material_jwl_omega = 0.0_rk + gas_material_pinf = 0.0_rk + gas_material_default_h = 1.0_rk + gas_material_default_mass = 1.0_rk + gas_material_default_volume = 1.0_rk gas_previous_equivalent_radius = 0.0_rk gas_previous_center = 0.0_rk call sph_db_clear_gas_diagnostics() @@ -85,11 +126,13 @@ contains subroutine sph_gas_note_material(name, material_type_in) character(len=*), intent(in) :: name character(len=*), intent(in) :: material_type_in + integer :: gas_index if (index(sph_gas_upper(material_type_in), 'GAS') > 0) then gas_material_seen = .true. gas_material_name = name gas_material_internal_id = sph_gas_find_material(name) + gas_index = sph_gas_register_material(name) end if end subroutine sph_gas_note_material @@ -122,12 +165,6 @@ contains ierr = SPH_ERROR_INPUT return end if - if (sph_gas_find_material(material_name_in) <= 0) then - call sph_error_set(SPH_ERROR_INPUT, 'Gas EOS references unknown material') - ierr = SPH_ERROR_INPUT - return - end if - if (index(upper_type, 'IDEAL_GAS') > 0) then call sph_gas_set_ideal(material_name_in, gamma, e0, p0, ierr) else if (index(upper_type, 'JWL') > 0) then @@ -147,6 +184,7 @@ contains real(rk), intent(in) :: e0 real(rk), intent(in) :: p0 integer, intent(out) :: ierr + integer :: gas_index ierr = SPH_SUCCESS if (gamma <= 1.0_rk) then @@ -159,6 +197,8 @@ contains ierr = SPH_ERROR_ARGUMENT return end if + call sph_gas_prepare_eos_material(material_name_in, gas_index, ierr) + if (ierr /= SPH_SUCCESS) return gas_material_seen = .true. gas_material_name = material_name_in gas_material_internal_id = sph_gas_find_material(material_name_in) @@ -167,6 +207,13 @@ contains gas_e0 = e0 gas_p0 = p0 gas_eos_defined = .true. + gas_material_eos_type(gas_index) = GAS_EOS_IDEAL + gas_material_eos_defined(gas_index) = .true. + gas_material_gamma(gas_index) = gamma + gas_material_energy_default(gas_index) = e0 + gas_material_p0(gas_index) = p0 + gas_material_rho0(gas_index) = sph_gas_material_density(material_name_in) + gas_material_density_default(gas_index) = sph_gas_material_density(material_name_in) end subroutine sph_gas_set_ideal subroutine sph_gas_set_jwl(material_name_in, rho0, a_value, b_value, r1, r2, & @@ -180,6 +227,7 @@ contains real(rk), intent(in) :: omega real(rk), intent(in) :: e0 integer, intent(out) :: ierr + integer :: gas_index ierr = SPH_SUCCESS if (rho0 <= 0.0_rk .or. r1 <= 0.0_rk .or. r2 <= 0.0_rk .or. & @@ -189,6 +237,8 @@ contains ierr = SPH_ERROR_ARGUMENT return end if + call sph_gas_prepare_eos_material(material_name_in, gas_index, ierr) + if (ierr /= SPH_SUCCESS) return gas_material_seen = .true. gas_material_name = material_name_in gas_material_internal_id = sph_gas_find_material(material_name_in) @@ -201,6 +251,16 @@ contains gas_jwl_omega = omega gas_e0 = e0 gas_eos_defined = .true. + gas_material_eos_type(gas_index) = GAS_EOS_JWL + gas_material_eos_defined(gas_index) = .true. + gas_material_rho0(gas_index) = rho0 + gas_material_jwl_a(gas_index) = a_value + gas_material_jwl_b(gas_index) = b_value + gas_material_jwl_r1(gas_index) = r1 + gas_material_jwl_r2(gas_index) = r2 + gas_material_jwl_omega(gas_index) = omega + gas_material_energy_default(gas_index) = e0 + gas_material_density_default(gas_index) = sph_gas_material_density(material_name_in) end subroutine sph_gas_set_jwl subroutine sph_gas_set_stiffened(material_name_in, rho0, gamma, e0, pinf, ierr) @@ -210,6 +270,7 @@ contains real(rk), intent(in) :: e0 real(rk), intent(in) :: pinf integer, intent(out) :: ierr + integer :: gas_index ierr = SPH_SUCCESS if (rho0 <= 0.0_rk .or. gamma <= 1.0_rk .or. e0 < 0.0_rk .or. & @@ -218,6 +279,8 @@ contains ierr = SPH_ERROR_ARGUMENT return end if + call sph_gas_prepare_eos_material(material_name_in, gas_index, ierr) + if (ierr /= SPH_SUCCESS) return gas_material_seen = .true. gas_material_name = material_name_in gas_material_internal_id = sph_gas_find_material(material_name_in) @@ -227,6 +290,13 @@ contains gas_e0 = e0 gas_pinf = pinf gas_eos_defined = .true. + gas_material_eos_type(gas_index) = GAS_EOS_STIFFENED + gas_material_eos_defined(gas_index) = .true. + gas_material_rho0(gas_index) = rho0 + gas_material_gamma(gas_index) = gamma + gas_material_energy_default(gas_index) = e0 + gas_material_pinf(gas_index) = pinf + gas_material_density_default(gas_index) = sph_gas_material_density(material_name_in) end subroutine sph_gas_set_stiffened subroutine sph_gas_set_particle_control(h_value, mass_value, volume_value, ierr) @@ -244,6 +314,11 @@ contains gas_default_h = h_value gas_default_mass = mass_value gas_default_volume = volume_value + if (gas_material_count > 0) then + gas_material_default_h(1:gas_material_count) = h_value + gas_material_default_mass(1:gas_material_count) = mass_value + gas_material_default_volume(1:gas_material_count) = volume_value + end if gas_particle_control_defined = .true. end subroutine sph_gas_set_particle_control @@ -261,23 +336,29 @@ contains subroutine sph_gas_validate_input(ierr) integer, intent(out) :: ierr + integer :: gas_index + integer :: mat_index ierr = SPH_SUCCESS if (.not. gas_material_seen) return - if (.not. gas_eos_defined) then - call sph_error_set(SPH_ERROR_INPUT, 'input is missing *SPHLITE EOS for Gas') - ierr = SPH_ERROR_INPUT - return - end if - if (.not. sph_gas_has_material_density()) then - call sph_error_set(SPH_ERROR_INPUT, 'input is missing *DENSITY for Gas material') - ierr = SPH_ERROR_INPUT - return - end if - if (.not. sph_gas_has_section_binding()) then - call sph_error_set(SPH_ERROR_INPUT, 'input is missing Gas section binding') - ierr = SPH_ERROR_INPUT - end if + do gas_index = 1, gas_material_count + mat_index = gas_material_ids(gas_index) + if (.not. gas_material_eos_defined(gas_index)) then + call sph_error_set(SPH_ERROR_INPUT, 'input is missing *SPHLITE EOS for Gas') + ierr = SPH_ERROR_INPUT + return + end if + if (mat_index < 1 .or. mat_index > material_count) then + call sph_error_set(SPH_ERROR_INPUT, 'Gas material table is invalid') + ierr = SPH_ERROR_INPUT + return + end if + if (material_density(mat_index) <= 0.0_rk) then + call sph_error_set(SPH_ERROR_INPUT, 'input is missing *DENSITY for Gas material') + ierr = SPH_ERROR_INPUT + return + end if + end do end subroutine sph_gas_validate_input logical function sph_gas_has_material_density() @@ -292,40 +373,52 @@ contains end do end function sph_gas_has_material_density - logical function sph_gas_has_section_binding() + logical function sph_gas_has_section_binding_for_id(mat_id) + integer, intent(in) :: mat_id integer :: i - sph_gas_has_section_binding = .false. + sph_gas_has_section_binding_for_id = .false. do i = 1, section_count - if (section_material_id(i) == gas_material_internal_id) then - sph_gas_has_section_binding = .true. + if (section_material_id(i) == mat_id) then + sph_gas_has_section_binding_for_id = .true. return end if end do - end function sph_gas_has_section_binding + end function sph_gas_has_section_binding_for_id subroutine sph_gas_apply_initial_conditions(ierr) integer, intent(out) :: ierr integer :: i + integer :: gas_index + integer :: mat_index real(rk) :: density_value ierr = SPH_SUCCESS if (.not. gas_material_seen) return call sph_gas_validate_input(ierr) if (ierr /= SPH_SUCCESS) return - density_value = sph_gas_material_density(gas_material_name) do i = 1, npart if (particle_status(i) /= SPH_STATUS_ACTIVE) cycle if (.not. sph_gas_is_material_particle(i)) cycle + mat_index = material_id(i) + gas_index = sph_gas_table_index_by_material_id(mat_index) + if (gas_index <= 0) then + call sph_error_set(SPH_ERROR_INPUT, 'Gas particle material has no EOS') + ierr = SPH_ERROR_INPUT + return + end if + density_value = material_density(mat_index) + if (density_value <= 0.0_rk) density_value = gas_material_density_default(gas_index) particle_phase(i) = SPH_PHASE_GAS rho(i) = density_value - internal_energy(i) = gas_e0 - temperature(i) = 293.15_rk - mass(i) = gas_default_mass - volume(i) = gas_default_volume - h(i) = gas_default_h + internal_energy(i) = gas_material_energy_default(gas_index) + temperature(i) = gas_material_temperature_default(gas_index) + mass(i) = gas_material_default_mass(gas_index) + volume(i) = gas_material_default_volume(gas_index) + h(i) = gas_material_default_h(gas_index) acc_body(:,i) = gas_body_force - call sph_gas_compute_pressure(rho(i), internal_energy(i), pressure(i), ierr) + call sph_gas_compute_pressure_for_material(mat_index, rho(i), & + internal_energy(i), pressure(i), ierr) if (ierr /= SPH_SUCCESS) return end do call sph_gas_update_diagnostics(ierr) @@ -376,6 +469,64 @@ contains end if end subroutine sph_gas_compute_pressure + subroutine sph_gas_compute_pressure_for_material(mat_index, rho_value, & + energy_value, pressure_value, ierr) + integer, intent(in) :: mat_index + real(rk), intent(in) :: rho_value + real(rk), intent(in) :: energy_value + real(rk), intent(out) :: pressure_value + integer, intent(out) :: ierr + integer :: gas_index + real(rk) :: relative_volume + + ierr = SPH_SUCCESS + pressure_value = 0.0_rk + if (rho_value <= 0.0_rk) then + call sph_error_set(SPH_ERROR_ARGUMENT, 'Gas density must be positive') + ierr = SPH_ERROR_ARGUMENT + return + end if + if (energy_value < 0.0_rk) then + call sph_error_set(SPH_ERROR_ARGUMENT, 'Gas internal energy must be non-negative') + ierr = SPH_ERROR_ARGUMENT + return + end if + gas_index = sph_gas_table_index_by_material_id(mat_index) + if (gas_index <= 0 .or. .not. gas_material_eos_defined(gas_index)) then + call sph_error_set(SPH_ERROR_INPUT, 'Gas particle material has no EOS') + ierr = SPH_ERROR_INPUT + return + end if + if (gas_material_eos_type(gas_index) == GAS_EOS_IDEAL) then + pressure_value = (gas_material_gamma(gas_index) - 1.0_rk) * & + rho_value * energy_value + gas_material_p0(gas_index) + else if (gas_material_eos_type(gas_index) == GAS_EOS_JWL) then + if (gas_material_rho0(gas_index) <= 0.0_rk) then + call sph_error_set(SPH_ERROR_ARGUMENT, 'JWL gas reference density must be positive') + ierr = SPH_ERROR_ARGUMENT + return + end if + relative_volume = gas_material_rho0(gas_index) / rho_value + pressure_value = gas_material_jwl_a(gas_index) * & + exp(-gas_material_jwl_r1(gas_index) * relative_volume) + & + gas_material_jwl_b(gas_index) * & + exp(-gas_material_jwl_r2(gas_index) * relative_volume) + & + gas_material_jwl_omega(gas_index) * energy_value / relative_volume + else if (gas_material_eos_type(gas_index) == GAS_EOS_STIFFENED) then + pressure_value = (gas_material_gamma(gas_index) - 1.0_rk) * & + rho_value * energy_value - & + gas_material_gamma(gas_index) * gas_material_pinf(gas_index) + else + call sph_error_set(SPH_ERROR_INPUT, 'Gas EOS is not defined') + ierr = SPH_ERROR_INPUT + return + end if + if (.not. sph_gas_is_finite(pressure_value)) then + call sph_error_set(SPH_ERROR_ARGUMENT, 'Gas pressure is not finite') + ierr = SPH_ERROR_ARGUMENT + end if + end subroutine sph_gas_compute_pressure_for_material + subroutine sph_gas_update_pressure(ierr) integer, intent(out) :: ierr integer :: i @@ -383,7 +534,8 @@ contains ierr = SPH_SUCCESS do i = 1, npart if (.not. sph_gas_is_active_particle(i)) cycle - call sph_gas_compute_pressure(rho(i), internal_energy(i), pressure(i), ierr) + call sph_gas_compute_pressure_for_material(material_id(i), rho(i), & + internal_energy(i), pressure(i), ierr) if (ierr /= SPH_SUCCESS) return end do end subroutine sph_gas_update_pressure @@ -596,9 +748,15 @@ contains real(rk) function sph_gas_sound_speed(i) integer, intent(in) :: i + integer :: gas_index real(rk) :: pressure_scale - pressure_scale = abs(pressure(i)) + abs(gas_pinf) + 1.0_rk + gas_index = sph_gas_table_index_by_material_id(material_id(i)) + if (gas_index > 0) then + pressure_scale = abs(pressure(i)) + abs(gas_material_pinf(gas_index)) + 1.0_rk + else + pressure_scale = abs(pressure(i)) + abs(gas_pinf) + 1.0_rk + end if sph_gas_sound_speed = sqrt(max(pressure_scale / rho(i), 1.0e-12_rk)) end function sph_gas_sound_speed @@ -650,6 +808,93 @@ contains end do end function sph_gas_material_density + subroutine sph_gas_prepare_eos_material(name, gas_index, ierr) + character(len=*), intent(in) :: name + integer, intent(out) :: gas_index + integer, intent(out) :: ierr + integer :: mat_index + + ierr = SPH_SUCCESS + gas_index = 0 + mat_index = sph_gas_find_material(name) + if (mat_index <= 0) then + call sph_error_set(SPH_ERROR_INPUT, 'Gas EOS references unknown material') + ierr = SPH_ERROR_INPUT + return + end if + if (index(sph_gas_upper(material_type(mat_index)), 'GAS') <= 0) then + call sph_error_set(SPH_ERROR_INPUT, 'Gas EOS references non-Gas material') + ierr = SPH_ERROR_INPUT + return + end if + gas_index = sph_gas_register_material(name) + if (gas_index <= 0) then + call sph_error_set(SPH_ERROR_INPUT, 'too many Gas material records') + ierr = SPH_ERROR_INPUT + return + end if + if (gas_material_eos_defined(gas_index)) then + call sph_error_set(SPH_ERROR_INPUT, 'Gas material EOS is already defined') + ierr = SPH_ERROR_INPUT + end if + end subroutine sph_gas_prepare_eos_material + + integer function sph_gas_register_material(name) + character(len=*), intent(in) :: name + integer :: mat_index + integer :: gas_index + + sph_gas_register_material = 0 + mat_index = sph_gas_find_material(name) + if (mat_index <= 0) return + gas_index = sph_gas_table_index_by_material_id(mat_index) + if (gas_index > 0) then + sph_gas_register_material = gas_index + return + end if + if (gas_material_count >= SPH_MAX_MATERIALS) return + gas_material_count = gas_material_count + 1 + gas_material_ids(gas_material_count) = mat_index + gas_material_names(gas_material_count) = material_name(mat_index) + gas_material_eos_defined(gas_material_count) = .false. + gas_material_eos_type(gas_material_count) = GAS_EOS_NONE + gas_material_density_default(gas_material_count) = material_density(mat_index) + gas_material_energy_default(gas_material_count) = gas_e0 + gas_material_temperature_default(gas_material_count) = 293.15_rk + gas_material_rho0(gas_material_count) = gas_rho0 + gas_material_gamma(gas_material_count) = gas_gamma + gas_material_p0(gas_material_count) = gas_p0 + gas_material_default_h(gas_material_count) = gas_default_h + gas_material_default_mass(gas_material_count) = gas_default_mass + gas_material_default_volume(gas_material_count) = gas_default_volume + sph_gas_register_material = gas_material_count + end function sph_gas_register_material + + integer function sph_gas_table_index_by_material_id(mat_index) + integer, intent(in) :: mat_index + integer :: i + + sph_gas_table_index_by_material_id = 0 + do i = 1, gas_material_count + if (gas_material_ids(i) == mat_index) then + sph_gas_table_index_by_material_id = i + return + end if + end do + end function sph_gas_table_index_by_material_id + + subroutine sph_gas_count_unbound_materials(count) + integer, intent(out) :: count + integer :: i + + count = 0 + do i = 1, gas_material_count + if (.not. sph_gas_has_section_binding_for_id(gas_material_ids(i))) then + count = count + 1 + end if + end do + end subroutine sph_gas_count_unbound_materials + logical function sph_gas_is_finite(value) real(rk), intent(in) :: value diff --git a/src/input/sph_input_reader.f90 b/src/input/sph_input_reader.f90 index 741c9c5..8eada95 100644 --- a/src/input/sph_input_reader.f90 +++ b/src/input/sph_input_reader.f90 @@ -15,7 +15,7 @@ module sph_input_reader sph_water_set_body_force, sph_water_apply_initial_conditions use sph_gas, only: sph_gas_note_material, sph_gas_set_eos, & sph_gas_set_particle_control, sph_gas_set_body_force, & - sph_gas_apply_initial_conditions + sph_gas_apply_initial_conditions, sph_gas_count_unbound_materials use sph_neighbor, only: sph_neighbor_rebuild use sph_inp_defs, only: SPH_INPUT_LINE_LEN, SPH_INPUT_FIELD_LEN, & SPH_INPUT_MAX_FIELDS, SPH_KEY_NODE, SPH_KEY_ELEMENT, SPH_KEY_NSET, & @@ -74,6 +74,7 @@ contains subroutine sph_input_build_model(ierr) integer, intent(out) :: ierr + integer :: gas_unbound_count ierr = SPH_SUCCESS if (npart <= 0) then @@ -102,6 +103,8 @@ contains if (ierr /= SPH_SUCCESS) return call sph_gas_apply_initial_conditions(ierr) if (ierr /= SPH_SUCCESS) return + call sph_gas_count_unbound_materials(gas_unbound_count) + input_warning_count = input_warning_count + gas_unbound_count call sph_neighbor_rebuild(ierr) end subroutine sph_input_build_model diff --git a/tests/data/gas_duplicate_eos_031.inp b/tests/data/gas_duplicate_eos_031.inp new file mode 100644 index 0000000..593ce55 --- /dev/null +++ b/tests/data/gas_duplicate_eos_031.inp @@ -0,0 +1,14 @@ +*NODE +1, 0.0, 0.0, 0.0 +*ELEMENT, TYPE=SPH3D +1, 1 +*ELSET, ELSET=AIR_PARTICLES +1 +*MATERIAL, NAME=AIR, TYPE=GAS +*DENSITY +1.2 +*SECTION, ELSET=AIR_PARTICLES, MATERIAL=AIR +*SPHLITE EOS, TYPE=IDEAL_GAS, MATERIAL=AIR, GAMMA=1.4, E0=2.0, P0=0.0 +*SPHLITE EOS, TYPE=IDEAL_GAS, MATERIAL=AIR, GAMMA=1.4, E0=3.0, P0=0.0 +*SPHLITE PARTICLE CONTROL, H=0.15, MASS=0.01, VOLUME=0.008 +*SPHLITE TIME CONTROL, DT=1.0E-6, TIME=1.0E-6, STEPS=1, SAFETY=0.5 diff --git a/tests/data/gas_eos_on_water_material_031.inp b/tests/data/gas_eos_on_water_material_031.inp new file mode 100644 index 0000000..c38e397 --- /dev/null +++ b/tests/data/gas_eos_on_water_material_031.inp @@ -0,0 +1,13 @@ +*NODE +1, 0.0, 0.0, 0.0 +*ELEMENT, TYPE=SPH3D +1, 1 +*ELSET, ELSET=WATER_PARTICLES +1 +*MATERIAL, NAME=WATER_MAT, TYPE=WATER +*DENSITY +1000.0 +*SECTION, ELSET=WATER_PARTICLES, MATERIAL=WATER_MAT +*SPHLITE EOS, TYPE=IDEAL_GAS, MATERIAL=WATER_MAT, GAMMA=1.4, E0=2.0, P0=0.0 +*SPHLITE PARTICLE CONTROL, H=0.15, MASS=1.0, VOLUME=0.001 +*SPHLITE TIME CONTROL, DT=1.0E-6, TIME=1.0E-6, STEPS=1, SAFETY=0.5 diff --git a/todo.md b/todo.md index 24806f7..0933577 100644 --- a/todo.md +++ b/todo.md @@ -33,26 +33,26 @@ ## 阶段 B:Gas 多材料输入解析与状态表 -- [ ] 为 Gas material 数量增加集中式统计字段。 -- [ ] 为 Gas material 内部 id 增加存储字段。 -- [ ] 为 Gas material 名称增加存储字段。 -- [ ] 为 Gas material EOS 类型增加存储字段。 -- [ ] 为 Gas material 密度默认值增加存储字段。 -- [ ] 为 Gas material 内能默认值增加存储字段。 -- [ ] 为 Gas material 温度默认值增加存储字段。 -- [ ] 为理想气体 EOS 增加 material 级参数表。 -- [ ] 为 JWL EOS 增加 material 级参数表。 -- [ ] 为 Stiffened gas EOS 增加 material 级参数表。 -- [ ] 增加 Gas material 状态表初始化过程。 -- [ ] 增加 Gas material 状态表清理过程。 -- [ ] 增加按 material 名称查找 Gas material id 的过程。 -- [ ] 将 `*MATERIAL, TYPE=GAS` 解析结果注册到 Gas material 状态表。 -- [ ] 将 `*SPHLITE EOS, MATERIAL=...` 解析结果绑定到对应 Gas material。 -- [ ] 对同一 Gas material 重复定义 EOS 的输入报 error。 -- [ ] 对非 Gas material 定义 Gas EOS 的输入报 error。 -- [ ] 对 Gas material 缺失 EOS 的输入报 error。 -- [ ] 对 Gas material 无 active 粒子的输入报 warning。 -- [ ] 保持 0.3.0 单 Gas material 输入兼容通过。 +- [x] 为 Gas material 数量增加集中式统计字段。 +- [x] 为 Gas material 内部 id 增加存储字段。 +- [x] 为 Gas material 名称增加存储字段。 +- [x] 为 Gas material EOS 类型增加存储字段。 +- [x] 为 Gas material 密度默认值增加存储字段。 +- [x] 为 Gas material 内能默认值增加存储字段。 +- [x] 为 Gas material 温度默认值增加存储字段。 +- [x] 为理想气体 EOS 增加 material 级参数表。 +- [x] 为 JWL EOS 增加 material 级参数表。 +- [x] 为 Stiffened gas EOS 增加 material 级参数表。 +- [x] 增加 Gas material 状态表初始化过程。 +- [x] 增加 Gas material 状态表清理过程。 +- [x] 增加按 material 名称查找 Gas material id 的过程。 +- [x] 将 `*MATERIAL, TYPE=GAS` 解析结果注册到 Gas material 状态表。 +- [x] 将 `*SPHLITE EOS, MATERIAL=...` 解析结果绑定到对应 Gas material。 +- [x] 对同一 Gas material 重复定义 EOS 的输入报 error。 +- [x] 对非 Gas material 定义 Gas EOS 的输入报 error。 +- [x] 对 Gas material 缺失 EOS 的输入报 error。 +- [x] 对 Gas material 无 active 粒子的输入报 warning。 +- [x] 保持 0.3.0 单 Gas material 输入兼容通过。 ## 阶段 C:EOS 分派、状态初始化与时间步