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

msh.make_bc api #213

Open
krober10nd opened this issue Apr 16, 2021 · 8 comments
Open

msh.make_bc api #213

krober10nd opened this issue Apr 16, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@krober10nd
Copy link
Collaborator

  • In some examples, it would be beneficial to show more of the API capabilities of make_bc. For example showing how to use both depth and distance bounds to label boundaries.
@krober10nd krober10nd added the enhancement New feature or request label Apr 16, 2021
@Jiangchao3
Copy link
Contributor

Jiangchao3 commented Apr 19, 2021

Hi @krober10nd

I have made a multiscale mesh that followed your suggestion.

mshopts = meshgen('ef',{fh_NSCS,fh_PRE},'bou',{gdat_NSCS,gdat_PRE},'plot_on',1,'proj','lam','nscreen',1);
mshopts = mshopts.build;
m = mshopts.grd;
plot(m,'type','tri');

It works well.

Now, I am making the open boundary condition.

m = make_bc(m,'auto',gdat_NSCS);
plot(m,'type','bd');

However, several open boundaries appeared in places that they should not have appeared.

Any suggestions to fix it? Thanks!

@Jiangchao3
Copy link
Contributor

I would try to use the 'delete' option in the make_bc function but it seems to be used to delete the boundaries rather than open boundaries.

@krober10nd
Copy link
Collaborator Author

Ah yea this is exactly why I had proposed this issue. You'll need to likely pass both depth and distance bounds. The probable issue is your river extends sufficiently far overland that the distance criteria is being met to classify as an ocean boundary.

'''
m= make_bc(m, gdat, 'auto', distance, depth, length);
'''

Where 'distance' indicates the distance in geographical degrees from the mainland, 'depth' indicates the depth that's sufficient to classify the node as an open ocean boundary, and 'length' is the minimum number of nodes to classify as an open boundary.

It's tricky I know but automatic classification of boundaries with meshes with rivers isn't easy.

See also the doc string for more information

Yes the delete option only deals with land/no flux boundaries

@krober10nd
Copy link
Collaborator Author

By the way, experience also tells me you'll probably need more nodes per width of those rivers to get flow up. I'd suggest a minimum of 4 for the feature size and make sure to change your minimum element size too.

@Jiangchao3
Copy link
Contributor

Jiangchao3 commented Apr 19, 2021

Thanks for your reply. After several tries, the open boundaries can be automatically classified well.

m = make_bc(m,'auto',gdat_NSCS,'both',0.1,20);

I used the above parameters, the result looks fine.

@Jiangchao3
Copy link
Contributor

By the way, experience also tells me you'll probably need more nodes per width of those rivers to get flow up. I'd suggest a minimum of 4 for the feature size and make sure to change your minimum element size too.

About meshing the river domain, thanks for your suggestion about the feature size parameter. I did use the feature size of 3 in the current mesh. Actually, I am just making the nested mesh at the moment, and I don't use this nested mesh to run an adcirc simulation yet. I will try to use a bigger feature size for the river domain. Thanks for the suggestion again.

@krober10nd
Copy link
Collaborator Author

About meshing the river domain, thanks for your suggestion about the feature size parameter. I did use the feature size of 3 in the current mesh. Actually, I am just making the nested mesh at the moment, and I don't use this nested mesh to run an adcirc simulation yet. I will try to use a bigger feature size for the river domain. Thanks for the suggestion again.

Okay, yea, since ADCIRC uses P=1 linear elements, the representation of the river channel is piecewise linear so it can be quite crude with only 3 or 4 elements across it's width. If the region you're modeling has large tides, sections of the coarsely resolved river may go artificially dry and lead to numerical instabilities.

@Jiangchao3
Copy link
Contributor

Okay, yea, since ADCIRC uses P=1 linear elements, the representation of the river channel is piecewise linear so it can be quite crude with only 3 or 4 elements across it's width. If the region you're modeling has large tides, sections of the coarsely resolved river may go artificially dry and lead to numerical instabilities.

Thanks, I can understand what you have said above. Wait for me to test meshes with different feature sizes and min_els to run an adcirc simulation.

Perhaps the effect or sensitivity of mesh resolution placement on the accuracy and speed of the simulation in the river domain may be an interesting issue. I did not notice any article or report about this issue, because adcirc are mainly used to model in the ocean domain.

By the way, it must be admitted that the function of feature mesh size in OM is very powerful, it uses an approximate medial axis to help mesh. I have read the paper you have cited (Jonas Koko: A Matlab mesh generator for the two-dimensional finite element method). I guess there is no other better tool that can mesh the river network easily and quickly. See the figure below, although the feature size needs to be further increased, it does not affect the performance of placing sufficient resolution in channels of different widths.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants