Reading .con file modflow usg

309 views
Skip to first unread message

Edinsson Muñoz

unread,
Aug 8, 2018, 11:44:12 PM8/8/18
to MODFLOW Users Group
Hi everyone,

I'm modelling a solute transport problem using bct package (modflow usg transport). This package creates a binary file (.con) with the results of the concentrations in every node. I'm interested in read this file, like i do with hds file, but as far as i know flopy doesn't have a module to read .con file.

Any idea of how read .con file? Is there a way to write .con file in ASCII format?

Thanks for helping
Regards
Edinsson

Chris Nicol

unread,
Aug 14, 2018, 12:54:53 AM8/14/18
to MODFLOW Users Group
Hello,

You can use flopy to do this, for example:

import flopy.utils.binaryfile as bf
ucnobj = bf.HeadUFile('exampleconcfile.CON', precision='single',text='conc') #mfusg uses "CONC" for the text field in the binary header of ucn files
ucnobj.list_records() #this will show you the times / layers available in your file
usgconcs = ucnobj.get_data(kstpkper=(3, 54)) #a list of conc numpy arrays for each layer in your model
l1conc = usgconcs[0] # example getting layer 1 concs in a numpy array - grid it up/plot it etc as you like...

This works for me using numpy 3.2.9. Hope this helps,

Chris.

Yamuna Subedi

unread,
Aug 14, 2018, 11:44:51 AM8/14/18
to mod...@googlegroups.com
thank you, everyone,
and again one question, how we plot observed head and simulated head in the model muse and what value should be added in head observation table???/ anyone helps me with that


Thank You

--
You received this message because you are subscribed to the Google Groups "MODFLOW Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modflow+unsubscribe@googlegroups.com.
To post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modflow.
For more options, visit https://groups.google.com/d/optout.

Edinsson Muñoz

unread,
Aug 14, 2018, 11:45:00 AM8/14/18
to mod...@googlegroups.com
Thank you Chris, It works

--
You received this message because you are subscribed to the Google Groups "MODFLOW Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modflow+u...@googlegroups.com.

Richard Winston

unread,
Aug 15, 2018, 12:41:45 AM8/15/18
to MODFLOW Users Group
1. Select "Data|Data Visualization".
2. Select "Head Observation Results".
3. Select the Head Observation Output file.
4. Click the Apply button.
The discrepancies will be plotted spatially. There is also a "Graph" tab in the Data Visualization dialog box where you can see simulated vs. observed heads.

Sent from BlueMail

john maw

unread,
Aug 16, 2018, 2:53:44 AM8/16/18
to mod...@googlegroups.com
Hi everyone,
Does anyone know how to create a BAS package Using Flopy. I just want one good example and I will figure out the rest on my own
Thanks
John

Christian Langevin

unread,
Aug 16, 2018, 10:05:06 AM8/16/18
to MODFLOW Users Group
Here is a minimal working example.  The key is that you need a model and discretization package before you can create the basic package. 

import flopy
m = flopy.modflow.Modflow()
dis = flopy.modflow.ModflowDis(m, nlay=1, nrow=5, ncol=6)
bas = flopy.modflow.ModflowBas(m)
bas.write_file() 

Felipe Kopplin

unread,
Feb 7, 2023, 11:50:05 PM2/7/23
to MODFLOW Users Group
Hi Chris,

Do you know if this work with multispecies concentration files? How can you read another species other that the first?

Thanks,
Felipe

Chris Nicol

unread,
Feb 12, 2023, 11:12:13 PM2/12/23
to MODFLOW Users Group
Hi Felipe,

No it won't work sorry. What I suggest you do is use USG-Transport's option to split out each species into it's on CON file (see the manual; search for the word "MULTIFILE"). Then Flopy will work with each of the .conc files for each species.

Hope that helps.
Reply all
Reply to author
Forward
0 new messages