Skip to content

display_temporal_criteria provokes segfault for NSTurbulent simple case #13

Closed
@Luispain

Description

@Luispain

Hi everyone,

I came through this issue when making slight adaptions to the provided example # - convergenceHistory (pyTree) -.

I started from such examples, and did slight adaptations :

  1. changed from Euler to NSTurbulent
  2. set modulo_verif = 1
  3. added a wall at imin
  4. added distance to wall
  5. set wall and farfield as families

The script is:

# - convergenceHistory (pyTree) -
import Converter.PyTree as C
import Generator.PyTree as G
import FastS.PyTree as FastS
import FastC.PyTree as FastC
import Connector.PyTree as X
import Converter.Internal as Internal
import Initiator.PyTree as I

ni = 155; dx = 100./(ni-1); dz = 0.01
a1 = G.cart((-50,-50,0.), (dx,dx,dz), (ni,ni,2))

C._addBC2Zone(a1, 'WALL', 'FamilySpecified:WALL', 'imin')
C._fillEmptyBCWith(a1, 'FARFIELD', 'FamilySpecified:FARFIELD', dim=2)
C._addState(a1, 'GoverningEquations', 'NSTurbulent')
I._initConst(a1, MInf=0.4, loc='centers')
C._addState(a1, MInf=0.4)
t = C.newPyTree(['Base', a1])
C._tagWithFamily(t,'FARFIELD')
C._tagWithFamily(t,'WALL')
C._addFamily2Base(t, 'FARFIELD', bndType='BCFarfield')
C._addFamily2Base(t, 'WALL', bndType='BCWall')

import Dist2Walls.PyTree as DTW
walls = C.extractBCOfType(t, 'BCWall')
DTW._distance2Walls(t, walls, loc='centers', type='ortho')


# Numerics
modulo_verif = 1
numb = {}
numb["temporal_scheme"]    = "implicit"
numb["ss_iteration"]       = 3
numb["modulo_verif"]       = modulo_verif
numz = {}
numz["time_step"]          = 0.0007
numz["time_step_nature"]   = "local"
numz["cfl"]                = 4.0
numz["scheme"]             = "roe"
numz["slope"]              = "minmod"
FastC._setNum2Zones(t, numz) ; FastC._setNum2Base(t, numb)

(t, tc, metrics) = FastS.warmup(t, None)

# Number or records to store residuals 
nrec = 100//modulo_verif

#To remove old ConvergenceHistory nodes 
t = C.rmNodes(t, "ZoneConvergenceHistory")

#Convergence history with nrec records
FastS.createConvergenceHistory(t, nrec)

nit = 100; time = 0
time_step = Internal.getNodeFromName(t, 'time_step')
time_step = Internal.getValue(time_step)
for it in range(nit):
    FastS._compute(t, metrics, it, tc)
    if it%modulo_verif == 0:
        FastS.display_temporal_criteria(t, metrics, it)
    time += time_step

# time stamp
Internal.createUniqueChild(t, 'Iteration', 'DataArray_t', value=nit)
Internal.createUniqueChild(t, 'Time', 'DataArray_t', value=time)
C.convertPyTree2File(t, 'out.cgns')

This script provokes segfault at termination (even if everything seems to be ok during computation).

The strange behavior is as follows: if we supress the line FastS.display_temporal_criteria(t, metrics, it), then the segfault dissappears.

Run on ONERA LD machine using cassiopee v4 environment.

Thank you in advance for your help,

Luis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions