Пример #1
0
def build(obsVars, step, modeltime):

    ### HOUSEKEEPING: IMPORTANT! ###

#     inputs = locals().copy()
    inputs = {'obsVars': sorted(obsVars.keys())}
    script = __file__

    ### MAKE STATS ###

    statsDict = {}
    formatDict = {}

    for varName, var in sorted(obsVars.items()):

        pevar = planetengine.standardise(var)
        var = pevar.var

        standardIntegralSuite = {
            'surface': ['volume', 'inner', 'outer'],
            'comp': ['mag', 'ang', 'rad'],
            'gradient': [None, 'ang', 'rad']
            }

        for inputDict in planetengine.utilities.suite_list(standardIntegralSuite):

            anVar = analysis.Analyse.StandardIntegral(
                var,
                **inputDict
                )
            statsDict[varName + '_' + anVar.opTag] = anVar

            formatDict[varName + '_' + anVar.opTag] = "{:.2f}"

    zerodAnalyser = analysis.Analyser(
        'zerodData',
        statsDict,
        formatDict,
        step,
        modeltime
        )
    analysers = [zerodAnalyser,] # MAGIC NAME: MUST BE DEFINED

    maincollector = analysis.DataCollector(analysers)
    collectors = [maincollector,] # MAGIC NAME: MUST BE DEFINED

    ### FIGS ###

    mainfig = visualisation.QuickFig(
        *sorted(obsVars.items()),
        figname = 'standard'
        )
    figs = [mainfig,] # MAGIC NAME: MUST BE DEFINED

    ### HOUSEKEEPING: IMPORTANT! ###

    return Grouper(locals())
Пример #2
0
    def make_data(system, step, modeltime):
        zerodDataDict = {
            'Nu':
            analysis.Analyse.DimensionlessGradient(system.temperatureField,
                                                   system.mesh,
                                                   surfIndexSet=system.outer,
                                                   baseIndexSet=system.inner),
            'avTemp':
            analysis.Analyse.ScalarFieldAverage(system.temperatureField,
                                                system.mesh),
            'VRMS':
            analysis.Analyse.VectorFieldVolRMS(system.velocityField,
                                               system.mesh),
            'surfVRMS':
            analysis.Analyse.VectorFieldSurfRMS(system.velocityField,
                                                system.mesh, system.outer),
            'avVisc':
            analysis.Analyse.ScalarFieldAverage(system.viscosityFn,
                                                system.mesh),
            'yielding':
            analysis.Analyse.ScalarFieldAverage(
                fn.branching.conditional([
                    (system.creepViscFn < system.plasticViscFn, 0.), (True, 1.)
                ]), system.mesh),
            'step':
            analysis.Analyse.ArrayStripper(step, (0, 0)),
            'modeltime':
            analysis.Analyse.ArrayStripper(modeltime, (0, 0)),
        }

        zerodFormatDict = {
            'Nu': "{:.1f}",
            'avTemp': "{:.2f}",
            'VRMS': "{:.2f}",
            'surfVRMS': "{:.2f}",
            'avVisc': "{:.1E}",
            'yielding': "{0:.0%}",
            'step': "{:.0f}",
            'modeltime': "{:.1E}",
        }

        zerodAnalyser = analysis.Analyser('zerodData', zerodDataDict,
                                          zerodFormatDict)
        dataCollector = analysis.DataCollector([
            zerodAnalyser,
        ])
        data = {
            'analysers': [
                zerodAnalyser,
            ],
            'collectors': [
                dataCollector,
            ],
        }
        return Grouper(data)
Пример #3
0
    def make_data(system, tools):

        zerodDataDict = {
            'Nu': analysis.Analyse.DimensionlessGradient(
                system.temperatureField,
                system.mesh,
                system.outer,
                system.inner,
                ),
            'avTemp': analysis.Analyse.ScalarFieldAverage(
                system.temperatureField,
                system.mesh,
                ),
            'VRMS': analysis.Analyse.VectorFieldVolRMS(
                system.velocityField,
                system.mesh,
                ),
            'surfVRMS': analysis.Analyse.VectorFieldSurfRMS(
                system.velocityField,
                system.mesh,
                system.outer,
                ),
            'step': analysis.Analyse.ArrayStripper(
                system.step,
                (0, 0),
                ),
            'modeltime': analysis.Analyse.ArrayStripper(
                system.modeltime,
                (0, 0),
                ),
            }

        zerodFormatDict = {
            'Nu': "{:.1f}",
            'avTemp': "{:.2f}",
            'VRMS': "{:.2f}",
            'surfVRMS': "{:.2f}",
            'step': "{:.0f}",
            'modeltime': "{:.1E}",
            }

        zerodAnalyser = analysis.Analyser('zerodData', zerodDataDict, zerodFormatDict)
        dataCollector = analysis.DataCollector([zerodAnalyser,])
        data = {
            'analysers': [zerodAnalyser,],
            'collectors': [dataCollector,],
            }

        return data