3.1.6.5. c3po.physicsDrivers.CRONOS2Driver module

Inheritance diagram of c3po.physicsDrivers.CRONOS2Driver

Contain the class CRONOS2Driver.

class c3po.physicsDrivers.CRONOS2Driver.CRONOS2Driver

Bases: PhysicsDriver

This is the implementation of PhysicsDriver for CRONOS2.

__init__()

Build a CRONOS2Driver object.

abortTimeStep()

See PhysicsDriver.abortTimeStep().

computeTimeStep()

See PhysicsDriver.computeTimeStep().

Description of the expected outputs for the ICOCO_COMPUTE_TIME_STEP gibiane subroutine:

  • The time step (floating-point number) must be output in the variable T_C3PO.'DT'

  • The stop flag (boolean) must be output in the variable T_C3PO.'STOP'

getInputMEDDoubleFieldTemplate(name)

See PhysicsDriver.getInputMEDDoubleFieldTemplate().

The gibiane subroutine ICOCO_GET_INPUT_MEDFIELD_TEMPLATE :

  • takes as input the name of the MED field template in the string T_C3PO.'name' ;

  • returns the required MED field template in the variable T_C3PO.'field_out' of type MEDFIELD.

getMEDCouplingMajorVersion()

(Optional) Get MEDCoupling major version, if the code was built with MEDCoupling support.

Mandatory if the code is built with MEDCoupling support. This can be used to assess compatibility between codes when coupling them.

Returns:

The MEDCoupling major version number (typically 7, 8, 9, …).

Return type:

int

getOutputDoubleValue(name)

See PhysicsDriver.getOutputDoubleValue().

The gibiane subroutine ICOCO_GET_VALUE :

  • takes as input the name of the value in the string T_C3PO.'name' ;

  • returns the required floating number value in the table T_C3PO.'value' at the index name.

getOutputMEDDoubleField(name)

See PhysicsDriver.getOutputMEDDoubleField().

The gibiane subroutine ICOCO_GET_OUTPUT_MEDFIELD :

  • takes as input the name of the MED field in the string T_C3PO.'name' ;

  • returns the required MED field in the variable T_C3PO.'field_out' of type MEDFIELD.

getStationaryMode()

(Mandatory) Indicate whether the code should compute a stationary solution or a transient one.

See also setStationaryMode().

Can be called whenever the code is outside the TIME_STEP_DEFINED context (see PhysicsDriver documentation).

Returns:

True if the code has been set to compute a stationary solution.

Return type:

bool

Raises:
initTimeStep(dt)

See PhysicsDriver.initTimeStep().

initialize()

See PhysicsDriver.initialize().

isMEDCoupling64Bits()

(Optional) Indicate whether the code was built with a 64-bits version of MEDCoupling.

Mandatory if the code is built with MEDCoupling support. This can be used to assess compatibility between codes when coupling them.

Returns:

True if the code was built with a 64-bits version of MEDCoupling.

Return type:

bool

presentTime()

See PhysicsDriver.presentTime().

resetTime(time_)

(Optional) Reset the current time of the PhysicsDriver to a given value.

New in version 2 of ICoCo. Particularly useful for the initialization of complex transients: the starting point of the transient of interest is computed first, the time is reset to 0, and then the actual transient of interest starts with proper initial conditions, and global time 0.

Can be called outside the TIME_STEP_DEFINED context (see PhysicsDriver documentation).

Parameters:

time_ (float) – The new current time.

Raises:
setDataFile(datafile)

See PhysicsDriver.setDataFile().

setInputDoubleValue(name, value)

See PhysicsDriver.setInputDoubleValue().

The gibiane subroutine ICOCO_SET_VALUE :

  • takes as input the name of the value in the string T_C3PO.'name' ;

  • takes as input the value stored in the table T_C3PO.'value' with the index name ;

  • sorts away the value in the appropriate data structures of CRONOS2.

setInputMEDDoubleField(name, field)

See PhysicsDriver.setInputMEDDoubleField().

The gibiane subroutine ICOCO_SET_INPUT_MEDFIELD :

  • takes as input the name of the MED field in the string T_C3PO.'name' ;

  • takes as input the name of the gibiane variable holding the MED field in the string T_C3PO.'FSaph' ;

  • sorts away the MED field in the appropriate PARAM structures of CRONOS2.

setParamDict(paramDict)

Set a new dictionary of names of CRONOS2 parameters in PARAM structures.

This function is reserved for advanced use only ; do not use it unless you know exactly what you are doing.

setStationaryMode(stationaryMode)

(Mandatory) Set whether the code should compute a stationary solution or a transient one.

New in version 2 of ICoCo. By default the code is assumed to be in stationary mode False (i.e. set up for a transient computation). If set to True, solveTimeStep() can be used either to solve a time step in view of an asymptotic solution, or to solve directly for the steady-state. In this last case, a time step = 0. can be used with initTimeStep() (whose call is always needed). The stationary mode status of the code can only be modified by this method (or by a call to terminate() followed by initialize()).

Can be called whenever the code is outside the TIME_STEP_DEFINED context (see PhysicsDriver documentation).

Parameters:

stationaryMode (bool) – True if the code should compute a stationary solution.

Raises:
solveTimeStep()

See PhysicsDriver.solveTimeStep().

terminate()

See PhysicsDriver.terminate().

validateTimeStep()

See PhysicsDriver.validateTimeStep().

class c3po.physicsDrivers.CRONOS2Driver.ParamKey

Bases: object

Keys for the dictionary of the names of CRONOS2 parameters in PARAM-type structures

DMOD = 'DMOD'
PUIS = 'PUIS'
TECO = 'TECO'
TMOD = 'TMOD'
inputKeys = ['TECO', 'DMOD', 'TMOD']
outputKeys = ['PUIS']