Skip to content

Adds variable Cd and Manning's n values #389

Merged
pwolfram merged 1 commit intoMPAS-Dev:ocean/coastalfrom
pwolfram:coastal/variable_bottom_drag
Feb 12, 2020
Merged

Adds variable Cd and Manning's n values #389
pwolfram merged 1 commit intoMPAS-Dev:ocean/coastalfrom
pwolfram:coastal/variable_bottom_drag

Conversation

@pwolfram
Copy link
Contributor

@pwolfram pwolfram commented Nov 6, 2019

Adds variable bottom drag capability as well as Manning's n values
for variable drag in coastal areas.

Note, equation for Manning's n conversion to Cd is Cd=g*n^2*h^(-1/3), where n is Manning's coefficient, g is gravity, and h is the total water depth.

Testing is against the drying slope case.

@pwolfram
Copy link
Contributor Author

pwolfram commented Nov 6, 2019

Note, need to remove RK4 fixes by Michael and need to squash commits. Can do this after folks have a chance to review the code.

@pwolfram
Copy link
Contributor Author

pwolfram commented Nov 6, 2019

Testing

variable Cd: ocean/drying_slope/zstar_variableCd/1km

dryingslopecomparison

variable Manning's n: ocean/drying_slope/zstar_variableManningn/1km

dryingslopecomparisonManningn

@pwolfram
Copy link
Contributor Author

pwolfram commented Nov 6, 2019

Could potentially use a function pointer to make things simpler @mark-petersen but kept standard approach we've been using and duplicated function but with need high-level key terms to keep functionality with switch outside any main loops for performance reasons.

@pwolfram
Copy link
Contributor Author

pwolfram commented Nov 7, 2019

@mark-petersen, can you please review? The "Don't Merge" label is just to point out that I have Michael's RK4 fix (needs removed since that will be merged into dev) and need to squash commits prior to the merge.

@mark-petersen
Copy link
Contributor

@pwolfram Please run your standard cases to exercise this code with gnu and intel compilers, using DEBUG=true.

@pwolfram pwolfram force-pushed the coastal/variable_bottom_drag branch from fc492c6 to de0516b Compare February 5, 2020 23:54
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@caozd999, here is the selection of different types of bottom drag you can use as an example to build your own transect and variable drag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/MPAS-Dev/MPAS-Model/pull/389/files#diff-6270014bc9ae9b8554f8af50127caf5fL242 above shows bottom depth that needs modified.

I recommend building your own new src/core_ocean/mode_init/mpas_ocn_init_tidal_transect.F case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll merge this PR here and you can do a new PR on top of this merged one.

@pwolfram pwolfram force-pushed the coastal/variable_bottom_drag branch 2 times, most recently from 1982e88 to 41ce7aa Compare February 6, 2020 01:05
@pwolfram
Copy link
Contributor Author

pwolfram commented Feb 6, 2020

@mark-petersen, here are the tests you've requested.

Testing

intel-debug

dryingslopecomparisonManningn

intel-release

dryingslopecomparisonManningn

Gnu to follow later...

@pwolfram
Copy link
Contributor Author

pwolfram commented Feb 6, 2020

Testing

gnu-release

dryingslopecomparisonManningn

gnu-debug

dryingslopecomparisonManningn

@pwolfram
Copy link
Contributor Author

pwolfram commented Feb 6, 2020

@mark-petersen and @sbrus89, I'm planning to merge because everything checks out. If you both could approve before I do this I would appreciate it.

Copy link

@sbrus89 sbrus89 left a comment

Choose a reason for hiding this comment

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

@pwolfram. This all looks good. I approve by visual inspection.

@sbrus89
Copy link

sbrus89 commented Feb 6, 2020

@pwolfram, the only comment I have would be that the existing constant bottom drag could be fit into this framework by just setting the bottomDrag variable to that constant. It adds an additional array for runs that don't require the spatially variable functionality, but would keep things simpler because there would be one fewer ocn_vel_vmix_tend_implicit routines.

Just a thought and definitely not an issue that should be addressed by this PR.

@pwolfram
Copy link
Contributor Author

pwolfram commented Feb 6, 2020

Thanks @sbrus89! I'll let @mark-petersen comment here, but believe we should skip that because it would modify the E3SM runtime and not necessarily be BFB. Minimally, it would change performance for large-scale runs with constant Cd. But, I agree, we are adding complexity via leaving that additional option in, which your approach would remove.

Copy link
Contributor

@mark-petersen mark-petersen left a comment

Choose a reason for hiding this comment

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

Glancing through, this looks fine. I don't have time to actually test, but I'm happy trusting your tests.

@pwolfram pwolfram force-pushed the coastal/variable_bottom_drag branch from 41ce7aa to 655bd9d Compare February 12, 2020 17:18
Adds spatially-variable Cd and Mannings n drag
capabilities.

Adds comparison of different use for Cd:
ocean/drying_slope/zstar_variableCd/1km

Adds variable Manning's n drying slope:
ocean/drying_slope/zstar_variableManningn/1km
@pwolfram pwolfram force-pushed the coastal/variable_bottom_drag branch from 655bd9d to 99d14c7 Compare February 12, 2020 17:20
pwolfram added a commit that referenced this pull request Feb 12, 2020
Adds spatially variable drag coefficient capability
based on Cd and n.
@pwolfram pwolfram merged commit 99d14c7 into MPAS-Dev:ocean/coastal Feb 12, 2020
@pwolfram
Copy link
Contributor Author

Thanks @mark-petersen, double-checked it worked on the merge commit I just pushed. Thanks also @sbrus89

@pwolfram pwolfram deleted the coastal/variable_bottom_drag branch February 12, 2020 18:45
@pwolfram
Copy link
Contributor Author

@caozd999, PR is now merged.

@caozd999
Copy link

@pwolfram great! Thank you.

end do

! average cell-based implicit bottom drag to edges and convert Mannings n to Cd
implicitCd = gravity*(0.5_RKIND*(bottomDrag(cell1) + bottomDrag(cell2)))**2.0 * &
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@caozd999, here is the example of how I converted Manning's n into Cd for computation in the momentum equations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants