Skip to content

Conversation

@Manangka
Copy link
Contributor

@Manangka Manangka commented Jun 30, 2025

This commit adds the new TVD flux limiter based on the paper of Darwish.

For now i called the new limiter UTVD where U stands for unstructured. But as @christianlangevin and i discussed last week this doesn't cover the because it is also suited for structured grids.

A small description of the code layout.
The main starting point is the tsp-adv.f90 file. Here the cell based gradient is created and passed on to the UTVD class.
I would recommend reviewing tsp-adv.f90 -> IGradient.f90/LeastSquaredGradient.f90 -> UTVDScheme.f90 first to follow the logic of the implementation.

A helper class DisUtils is added which provided common functions e.g. getting a cell centroid location

I've updated existing advection tests to also test the new limiter.

It depends on #2367 and #2370

Checklist of items for pull request

  • Replaced section above with description of pull request
  • Closed issue #xxxx
  • Referenced issue or pull request #xxxx
  • Added new test or modified an existing test
  • Ran ruff on new and modified python scripts in .doc, autotests, doc, distribution, pymake, and utils subdirectories.
  • Formatted new and modified Fortran source files with fprettify
  • Added doxygen comments to new and modified procedures
  • Updated meson files, makefiles, and Visual Studio project files for new source files
  • Updated definition files
  • Updated develop.toml with a plain-language description of the bug fix, change, feature; required for changes that may affect users
  • Updated input and output guide
  • Removed checklist items not relevant to this pull request

For additional information see instructions for contributing and instructions for developing.

@Manangka Manangka force-pushed the unstructured_fluxlimiter branch 4 times, most recently from 866076a to 1240d20 Compare June 30, 2025 12:01
@Manangka Manangka force-pushed the unstructured_fluxlimiter branch from 1240d20 to dfeb932 Compare June 30, 2025 13:10
Manangka added 2 commits July 1, 2025 19:04
# Conflicts:
#	make/makefile
#	msvs/mf6core.vfproj
#	src/Model/TransportModel/InterpolationScheme/AdvSchemeEnum.f90
#	src/Model/TransportModel/InterpolationScheme/CentralDifferenceScheme.f90
#	src/Model/TransportModel/InterpolationScheme/TVDScheme.f90
#	src/Model/TransportModel/tsp-adv.f90
#	src/Utilities/LinearAlgebraUtils.f90
#	src/meson.build
@Manangka Manangka force-pushed the unstructured_fluxlimiter branch from 42b2e65 to 1306626 Compare July 1, 2025 20:23
@Manangka Manangka marked this pull request as ready for review July 2, 2025 15:48
Copy link
Contributor

@aprovost-usgs aprovost-usgs left a comment

Choose a reason for hiding this comment

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

Elegant code. Just minor things for your consideration

Manangka added 3 commits July 11, 2025 20:43
# Conflicts:
#	make/makefile
#	src/Model/TransportModel/tsp-adv.f90
Copy link
Contributor

@mjr-deltares mjr-deltares left a comment

Choose a reason for hiding this comment

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

I really like how you did this. I do think we need to present the core design to the team so if they visit tsp-adv, they know what is going on there. You have increased the level of software engineering to come up with a better structured code, and succeeded. Let's make sure people can follow along.


select case (this%limiter_id)
case (2) ! van Leer
theta = max(0.0_dp, min((r + dabs(r)) / (1.0_dp + dabs(r)), 2.0_dp))
Copy link
Contributor

Choose a reason for hiding this comment

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

I know we have DZERO, DONE, etc. but I like it better how you have done it here, it's readable

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice to isolate generic functionality. There are similar units in the ModelUtilities folder. Should this go there as well?

Copy link
Contributor

@aprovost-usgs aprovost-usgs left a comment

Choose a reason for hiding this comment

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

Nice job, @Manangka

@Manangka Manangka merged commit 18776b8 into MODFLOW-ORG:develop Aug 1, 2025
20 checks passed
@wpbonelli wpbonelli added this to the 6.7.0 milestone Sep 18, 2025
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.

4 participants