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

BUG for low porosity cubic volumes #94

Closed
isaacsquires opened this issue Nov 8, 2023 · 2 comments
Closed

BUG for low porosity cubic volumes #94

isaacsquires opened this issue Nov 8, 2023 · 2 comments

Comments

@isaacsquires
Copy link
Member

  • TauFactor version: 1.1.0
  • Python version: 3.9
  • Operating System: Ubuntu 20

Description

Trying to get tau for low porosity cubes in cubes. Started not converging properly when porosity below 0.2. Noticed conv error jumping up and simulation ending after minimum number of iterations.

@amirDahari1
Copy link
Member

Problem is negative flux causing err < 0 in def check_vertical_flux(self, conv_crit):

Possible fix 1:
Change the error from
err = (fl.max() - fl.min())*2/(fl.max() + fl.min())
into
err = (fl.max() - fl.min())*2/(fl.max())
or err = (fl.max() - fl.min())*2/(fl.max() + abs(fl.min()))

Possible fix 2:
make the error an absolute one, i.e.
err = abs((fl.max() - fl.min())*2/(fl.max() + fl.min()))

I vote for the first option since if fl.max() ~= -fl.min() than the error can be really large or cause division by zero error in the extreme case that they're equal.

@amirDahari1
Copy link
Member

#95 Possible fix

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

When branches are created from issues, their pull requests are automatically linked.

2 participants