Skip to content

AA/adaptive-dt#103

Merged
mberto79 merged 54 commits intomberto79:mainfrom
egyaa20:AA/adaptive-dt
Feb 26, 2026
Merged

AA/adaptive-dt#103
mberto79 merged 54 commits intomberto79:mainfrom
egyaa20:AA/adaptive-dt

Conversation

@egyaa20
Copy link
Contributor

@egyaa20 egyaa20 commented Feb 24, 2026

Add optional adaptive time-stepping via a new (optional) AdaptiveTimeStepping configuration block inside Runtime, ensuring compatability with other solvers and test cases. Time-step updates are handled through multiple dispatch update_dt! function to avoid if statements when adaptative stepping is turned on/off.

mberto79 and others added 30 commits October 1, 2025 20:51
… be referenced in `multiphase_sources` framework
…lip Velocity Model`, `Gravity Source`, `Artificial Phase Compression`, `Continuum Surface Force` (surface tension source)
…, `Perfect Gas EoS`, `Peng-Robinson EoS`, `Helmholtz-Energy EoS`, `Const Viscosity`, `Sutherland's Viscosity Model`, `Andrade Viscosity Correlation`.
- Involves testing `gravity` effects via water column collapse scenario.
- Also tests such fluid models as `Perfect Gas`, `Andrade's Correlation`, `Sutherland's Law`
…`p_rgh` formulation.

- Hides untested sources.
- Added documentation.
…energy model.

- Irrelevant code was removed.
…nstantScalar` value for temperature field.
@mberto79 mberto79 self-requested a review February 25, 2026 09:35
@mberto79 mberto79 self-assigned this Feb 25, 2026
Copy link
Owner

@mberto79 mberto79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@egyaa20 just added a few minor comments, the main change is to make modification to ensure this PR is GPU compatible. To allow this, I have left comment through the code, in addition, we need a new constructor for the Configuration type (in the file simulate_0_types.jl. Where we define the struct as:

@kwdef struct Configuration{SC,SL,RT,HW,BC,PP}
    schemes::SC
    solvers::SL
    runtime::RT
    hardware::HW
    boundaries::BC
    postprocess::PP = nothing
end
Adapt.@adapt_structure Configuration

We need to remove the default keyword constructor that's created with the @kwdef macro i.e.:

struct Configuration{SC,SL,RT,HW,BC,PP}
    schemes::SC
    solvers::SL
    runtime::RT
    hardware::HW
    boundaries::BC
    postprocess::PP
end
Adapt.@adapt_structure Configuration

Within a new custom constructor definition we will need to move the runtime object to the GPU so it can be accessed within kernels, it would look something like:

Configuration(; schemes, solvers, runtime, hardware, boundaries, postprocess=nothing) = begin
Configuration(
    schemes=schemes, 
    solvers=solvers, 
    hardware=hardware, 
    boundaries=boundaries, 
    postprocess=postprocess, 
    runtime=adapt(hardware.backend, runtime)
)
end

That should do it (although please check I didn't run the pseudo code above 🫤 )

Once we confirm GPU compitibility, I think this is ready to merge! Thanks!

@egyaa20 egyaa20 requested a review from mberto79 February 26, 2026 08:06
@mberto79 mberto79 merged commit 47ce3e6 into mberto79:main Feb 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants