Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
D
dorie
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 31
    • Issues 31
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • dorie
  • dorie
  • Issues
  • #175

Closed
Open
Opened Jan 09, 2020 by Lukas Riedel@lriedelOwner

Introduce Model::pre_step() method to set boundary condition times independently from step computation

In the coupled model, the flux reconstruction at the begin of the step uses the previous boundary conditions, but that currently does not matter because we apply the NextStep policy when evaluating it.

Description

During the Model::step() method, the Richards model applies the current start time to its boundary condition manager to retrieve the correct BCs during the step. Before calling step(), the boundary condition manager therefore applies the boundary conditions of the previous step.

Proposal

Extend the base Model interface with a virtual pre_step() method which does nothing by default. Override this method in the Richards model to apply the current time to the boundary condition manager. Additionally, the flux reconstruction cache can be reset in this method rather than at the end of step().

Within the coupled model, call pre_step() on the Richards model before fetching the water flux reconstruction, such that the current boundary conditions are correctly applied. Then, call step() and retrieve the second reconstruction. See above for an

Additionally, raise a warning in the Richards model if step() is called without calling pre_step() before.

void ModelRichardsTransportCoupling<Traits>::step()
{
  // ... //

  // NOTE: Proposal. Make sure the boundary condition manager returns the BCs for this time step
  //_richards->pre_step();

  // set initial state of the water flux to container
  auto gf_water_flux_begin   = _richards->get_water_flux_reconstructed();
  igf_water_flux->push(gf_water_flux_begin,time_begin);
  //                                       ^----- Currently applies the old BC for this time

  // always do an step of richards
  _richards->step();
  //         ^----- Currently enables the correct BCs for this step

  // ... //  

  // set final state of the water flux to container
  auto gf_water_flux_end    = _richards->get_water_flux_reconstructed();
  igf_water_flux->push(gf_water_flux_end,time_end);
  //                                     ^----- Applies the correct BC for this time

  // ... //

How to test the implementation?

  • Extend test-model-base to check if pre_step() is called during run().

Related issues

Edited Jan 10, 2020 by Lukas Riedel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dorie/dorie#175