Skip to content

an example to visualize segment and connection structure for multisegment wells. #4886

Merged
bska merged 7 commits into
OPM:masterfrom
GitPaean:visualizing_multisegment_wells
Jan 12, 2026
Merged

an example to visualize segment and connection structure for multisegment wells. #4886
bska merged 7 commits into
OPM:masterfrom
GitPaean:visualizing_multisegment_wells

Conversation

@GitPaean
Copy link
Copy Markdown
Member

@GitPaean GitPaean commented Jan 8, 2026

In the real applications, there are some rather complicated multisegment well structure. Having a visual understanding of the segment structure can provide insight to the iteration behavoir and solution of the well.

For simple cases, it is possible to run plot_ms_well CASE.DATA to get .gv output for all the multisegment wells,

with dot -Tpdf PROD01.gv -o PROD01.pdf to generate the pdf visualization.

pdf can also be png here.

For some cases that generates the wells on the flight, you might need to call the function writeWellStructure() directly in the proper place to generate the .gv for the wells you want.

Many code is following the example wellgraph.

Below are some visualization examples,

P1 PROD01

@GitPaean GitPaean added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Jan 8, 2026
@GitPaean
Copy link
Copy Markdown
Member Author

GitPaean commented Jan 8, 2026

jenkins build this please

@GitPaean GitPaean force-pushed the visualizing_multisegment_wells branch from f37da0b to 001eef3 Compare January 9, 2026 09:33
@GitPaean
Copy link
Copy Markdown
Member Author

GitPaean commented Jan 9, 2026

jenkins build this please

Comment thread opm/utility/WellStructureViz.hpp
@GitPaean
Copy link
Copy Markdown
Member Author

GitPaean commented Jan 9, 2026

jenkins build this please

@GitPaean GitPaean requested review from atgeirr and bska January 9, 2026 11:54
Copy link
Copy Markdown
Member

@bska bska left a comment

Choose a reason for hiding this comment

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

I think I'd personally use fmt::format() instead of operator<<() for the individual output statements, but other than that this looks good to me.

You might want to use std:cerr instead of std::cout for the diagnostic information though.

Comment thread examples/plot_ms_wells.cpp Outdated
Comment on lines +98 to +101
std::cout << "\n\n***** Caught an exception: " << e.what() << std::endl;
std::cout << "\n\n***** Printing log: "<< std::endl;
std::cout << os.str();
std::cout << "\n\n***** Exiting due to errors." << std::endl;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This kind of diagnostic information should probably go to std::cerr instead of std::cout.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

now I read that many are suggesting to use std::cerr for even progress reporting output and claims it to be the better approach due to its unbuffered nature. What is your take on this? I can do that if suggested so while I do not think it is so critical though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

now I read that many are suggesting to use std::cerr for even progress reporting output and claims it to be the better approach due to its unbuffered nature. What is your take on this?

I mean, generally, yes std::cerr is preferable for that kind of reporting.

I can do that if suggested so while I do not think it is so critical though.

No need. The current version is good enough for me.

@blattms
Copy link
Copy Markdown
Member

blattms commented Jan 9, 2026

Please provide a help page to make this usable for others and intall the binary

@GitPaean GitPaean force-pushed the visualizing_multisegment_wells branch 2 times, most recently from 7e213a4 to 5c7c1d4 Compare January 9, 2026 19:35
@GitPaean GitPaean force-pushed the visualizing_multisegment_wells branch from 5c7c1d4 to 032554b Compare January 9, 2026 19:38
@GitPaean
Copy link
Copy Markdown
Member Author

GitPaean commented Jan 9, 2026

jenkins build this please

Copy link
Copy Markdown
Member

@bska bska left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the updates. This looks good to me now and is a very welcome tool. I'll merge into master.

@bska bska merged commit 7a8a76e into OPM:master Jan 12, 2026
2 checks passed
@GitPaean GitPaean deleted the visualizing_multisegment_wells branch January 12, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants