Skip to content

Commit 07cfb5c

Browse files
committed
Add support for AUTOUGH2 EOS EWCX and EWAX in t2data json()
1 parent 1abf4be commit 07cfb5c

File tree

3 files changed

+32
-12
lines changed

3 files changed

+32
-12
lines changed

doc/source/t2data.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,12 +1380,13 @@ unique.
13801380
corresponding to the AUTOUGH2 EOS names (EOS1 being 'EW', EOS2
13811381
being 'EWC' etc.). Note that for integer values, only EOS modules
13821382
1, 2, 3 and 4 are supported. For AUTOUGH2 EOS names, these
1383-
correspond to 'W', 'EW', 'EWC', 'EWA' and 'EWAV'. The AUTOUGH2
1384-
passive tracer EOS modules 'EWT' and 'ETD' are also supported (the
1385-
latter supporting only constant diffusivity, i.e. all elements of
1386-
the ``diffusion`` property must be negative and equal). For EOS4
1387-
('EWAV'), alternative initialization using EOS3-style primary
1388-
variables via MOP(19) = 2 is supported.
1383+
correspond to 'W', 'EW', 'EWC' (or 'EWCX'), 'EWA' and 'EWAV' (or
1384+
'EWAX'). The AUTOUGH2 passive tracer EOS modules 'EWT' and 'ETD'
1385+
are also supported (the latter supporting only constant
1386+
diffusivity, i.e. all elements of the ``diffusion`` property must
1387+
be negative and equal). For EOS4 ('EWAV'), alternative
1388+
initialization using EOS3-style primary variables via MOP(19) = 2
1389+
is supported.
13891390

13901391
- | **bdy_incons**: :ref:`t2incon <incons>`, or ``None``
13911392
| TOUGH2 initial conditions from which boundary conditions are to be

t2data.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,14 +2159,17 @@ def eos_json(self, eos):
21592159
"""
21602160
jsondata = {}
21612161
supported_eos = {'W': 'w', 'EW': 'we', 'EWC': 'wce', 'EWA': 'wae',
2162-
'EWAV': 'wae', 'EWT': 'we', 'EWTD': 'we'}
2162+
'EWAV': 'wae', 'EWT': 'we', 'EWTD': 'we',
2163+
'EWAX': 'wae', 'EWCX': 'wce'}
21632164
primary_converters = {'W': convert_primary_eos_1,
21642165
'EW': convert_primary_eos_1,
21652166
'EWC': convert_primary_eos_2_or_4,
21662167
'EWA': convert_primary_eos_3,
21672168
'EWAV': convert_primary_eos_2_or_4,
21682169
'EWT': convert_primary_eos_1,
2169-
'EWTD': convert_primary_eos_1
2170+
'EWTD': convert_primary_eos_1,
2171+
'EWAX': convert_primary_eos_2_or_4,
2172+
'EWCX': convert_primary_eos_2_or_4
21702173
}
21712174
aut2eosname = ''
21722175
primary_converter = None
@@ -2191,14 +2194,16 @@ def eos_json(self, eos):
21912194
primary_converter = primary_converters[aut2eosname]
21922195
if aut2eosname == 'EWA':
21932196
if self.parameter['option'][19] > 0:
2194-
raise Exception ('EOS3 with MOP(19) > 0 not supported.')
2195-
elif aut2eosname == 'EWAV':
2197+
raise Exception ('EOS %s with MOP(19) > 0 not supported.' % \
2198+
aut2eosname)
2199+
elif aut2eosname in ['EWAV', 'EWAX']:
21962200
if self.parameter['option'][19] == 1:
2197-
raise Exception ('EOS4 with MOP(19) = 1 not supported.')
2201+
raise Exception ('EOS %s with MOP(19) = 1 not supported.' % \
2202+
aut2eosname)
21982203
elif self.parameter['option'][19] == 2:
21992204
primary_converter = convert_primary_eos_3
22002205
else:
2201-
raise Exception ('EOS not supported:' + aut2eosname)
2206+
raise Exception ('EOS %s not supported.' % aut2eosname)
22022207
else:
22032208
raise Exception ('EOS not detected.')
22042209
if aut2eosname in ['EWT', 'EWTD']:

tests/test_t2data.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,20 @@ def eos_test():
674674
with self.assertRaises(Exception):
675675
dat.eos_json(eos)
676676

677+
eos = 'EWSG'
678+
with self.assertRaises(Exception):
679+
dat.eos_json(eos)
680+
681+
eos = 'EWAX'
682+
eos_data, tracer_data, pc = dat.eos_json(eos)
683+
self.assertEqual(eos_data['eos'], {'name': 'wae'})
684+
self.assertIsNone(tracer_data)
685+
686+
eos = 'EWCX'
687+
eos_data, tracer_data, pc = dat.eos_json(eos)
688+
self.assertEqual(eos_data['eos'], {'name': 'wce'})
689+
self.assertIsNone(tracer_data)
690+
677691
def output_test():
678692

679693
dat = t2data()

0 commit comments

Comments
 (0)