Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jürgen Becker

Pages: [1]
1
Dear Caroline,

if you can do this depends on the origin of your structure model.

When you have all the analytic information (GAD data) of the structure (e.g. because it is the result of a FiberGeo - Create command),  you can use GadGeo - Edit Domain to rescale the whole model into a new voxel mesh. See https://geodict-userguide.math2market.de/2025/gadgeo_editdomain.html for details. This allows to rescale by non-integer factors.

When you import gray-value images in ImportGeo-Vol, you can also change the image resolution, and resample the gray values to a  new image with any given resolution.   

What you cannot do is to resample the voxel mesh with arbitrary factors. Here (in ProcessGeo), only integer values possible.

Regrads,
Jürgen


2
Hi,

the first formula ((16) of DiffuDict 2023 User Guide) is used to compute the 3x3 diffusivity matrix from a set of tracked molecules. For every molecule we have a start point \( x_0 \) and an end point \( x_t \) and we can use this set  to compute the diffusivity by:
\[ D=\frac{E((x_t-x_0)(x_t-x_0)^T)}{2t}  \]
The 3D geometry and the velocity are an input for the simulation in this case.

Your second formula is actually formula (17) of the DiffuDict 2023 User Guide:
\[ d_0=\frac{1}{3}L\bar{v} \]
where our char. Length L is your d, and the mean thermal velocity is
\[ \bar{v}=\sqrt{\frac{8RT}{\pi M_A}} \]
(which is also formula (26) of the User Guide). This computes the one-dimensional diffusivity of a cylindrical pore and neglects all 3D effects that a more complex structure may show. However, by assuming that there is some characteristic length L of the 3D structure, one can use the value \( d_0 \) as a scaling factor for the diffusivity computed with Einsteins formula, and then one gets a dimensionless 3x3 diffusivity \( D^{\ast} \) that is independent from the diffusing species.  This is then formula (18) of the User Guide:
\[ D=d_0\cdot D^{\ast} \]
The \( D^{\ast} \) could be understood as the three-dimensional pore shape factor that is missing in your cylindrical pore formula.

However, if you have a look at page 38 of the DiffuDict 2023 User Guide, you can see that if you enter GeoDict with a single cylindrical pore structure, you get exactly the result from your second formula in the pore direction (and 0 in all other directions).

Best regards.   
 

3
Hi Tetsuo,

as a remark: In GeoDict 2022, it will be possible to access the SetTemperature command also through the context menu of the Status section (right click on the Constituent Materials entry). So it will be possible to record it in a macro, too.

Regards,
Jürgen

4
Dear Tetsuo,
there exists a command that let's you change the temperature, it's syntax is fairly simple:

Code: [Select]
SetTemperature_args = {
  'Temperature' : (293.15, 'K'),
  }
gd.runCmd("GeoDict:SetTemperature", SetTemperature_args, "2021")
It changes the temperate in the current constituent material settings. When using this command in a macro, you have to be aware that most commands (e.g. in FlowDict) contain their own set of material parameters. Therefore, after changing the temperature, it will be changed in the active settings, but not in the recorded command. So you have to take the active settings with

Code: [Select]
gd.getConstituentMaterials( "2021" )
 and insert these constituent materials in the parameter list of the FlowDict command, before calling the flow solver.

The following macro gives an example how this can be done:



Code: [Select]
Header =  {
  'Release' : '2021',
  }

Description = '''
Compute flow for different temperatures.
'''


def createBaseGeo():
    Create_args_1 = {
      'Domain' : {
        'PeriodicX'         : False,
        'PeriodicY'         : False,
        'PeriodicZ'         : False,
        'OriginX'           : (0, 'm'),
        'OriginY'           : (0, 'm'),
        'OriginZ'           : (0, 'm'),
        'VoxelLength'       : (1e-06, 'm'),
        'DomainMode'        : 'VoxelNumber',   # Possible values: VoxelNumber, Length, VoxelNumberAndLength
        'NX'                : 100,
        'NY'                : 100,
        'NZ'                : 100,
        'Material' : {
          'Name'        : 'Air',
          'Type'        : 'Fluid', # Possible values: Fluid, Solid, Porous, Undefined
          'Information' : '',
          },
        'OverlapMode'       : 'GivenMaterial', # Possible values: OverlapMaterial, NewMaterial, OldMaterial, GivenMaterial
        'OverlapMaterialID' : 3,
        'NumOverlapRules'   : 2,
        'OverlapRule1' : {
          'MaterialID1'       : 1,
          'MaterialID2'       : 1,
          'OverlapMaterialID' : 1,
          },
        'OverlapRule2' : {
          'MaterialID1'       : 2,
          'MaterialID2'       : 2,
          'OverlapMaterialID' : 2,
          },
        'HollowMaterialID'  : 0,
        'PostProcessing' : {
          'ResolveOverlap'    : False,
          'MarkContactVoxels' : False,
          'ContactMaterialID' : 3,
          },
        },
      'MaximalTime'              : (24, 'h'),
      'OverlapMode'              : 'AllowOverlap', # Possible values: AllowOverlap, RemoveOverlap, ForceConnection, IsolationDistance, ProhibitWithExisting, ProhibitOverlap, MatchSVFDistribution
      'StoppingCriterion'        : 'SolidVolumePercentage',# Possible values: SolidVolumePercentage, NumberOfObjects, Grammage, Density, WeightPercentage, FillToRim, SVP, Number
      'NumberOfObjects'          : 100,
      'SolidVolumePercentage'    : (10, '%'),
      'Grammage'                 : (10, 'g/m^2'),
      'Density'                  : (0, 'g/cm^3'),
      'WeightPercentage'         : (0, '%'),
      'SaveGadStep'              : 10,
      'RecordIntermediateResult' : False,
      'InExisting'               : False,
      'KeepStructure'            : False,
      'MatchSVFDistribution' : {
        'ErrorBound'         : 0.001,
        'CoarseningFactor'   : 10,
        'MatchMode'          : 'Gauss',      # Possible values: Gauss, Gradient
        'RelativeDensity'    : True,
        'DensityFunction' : {
          'XValues' : [0, 0.5, 1],
          'YValues' : [1, 0.1, 1],
          },
        'CorrelationLengthX' : (2e-05, 'm'),
        'CorrelationLengthY' : (2e-05, 'm'),
        'CorrelationLengthZ' : (1e-05, 'm'),
        'StandardDeviation'  : 0.5,
        },
      'RemoveOverlap' : {
        'Iterations'        : 1000,
        'OverlapSVP'        : (0, '%'),
        'SVPUnchanged'      : 20,
        'AllowShift'        : True,
        'AllowRotation'     : True,
        'AllowDeformation'  : True,
        'NumberOfShifts'    : 10,
        'ShiftDistance'     : (2, 'Voxel'),
        'NumberOfRotations' : 20,
        'MaximalAngle'      : 60,
        'DistanceMode'      : 'Touch',      # Possible values: Touch, Overlap, Isolation, AvoidContact
        'IsolationDistance' : (0, 'm'),
        'MaximalOverlap'    : (0, 'm'),
        },
      'IsolationDistance'        : (0, 'm'),
      'PercentageType'           : 0,
      'RandomSeed'               : 47,
      'ResultFileName'           : 'FiberGeo.gdr',
      'MatrixDensity'            : (0, 'g/cm^3'),
      'MaterialMode'             : 'Material',     # Possible values: Material, MaterialID
      'MaterialIDMode'           : 'MaterialIDPerObjectType',# Possible values: MaterialIDPerObjectType, MaterialIDPerMaterial
      'OverlapMaterial' : {
        'Name'        : 'Glass',
        'Type'        : 'Solid',   # Possible values: Fluid, Solid, Porous, Undefined
        'Information' : 'Overlap',
        },
      'ContactMaterial' : {
        'Name'        : 'Glass',
        'Type'        : 'Solid',   # Possible values: Fluid, Solid, Porous, Undefined
        'Information' : 'Contact',
        },
      'NumberOfGenerators'       : 2,
      'Generator1' : {
        'Material' : {
          'Name'        : 'Glass',
          'Type'        : 'Solid', # Possible values: Fluid, Solid, Porous, Undefined
          'Information' : 'Fiber',
          },
        'Probability'             : 0.5,
        'SpecificWeight'          : (2.58, 'g/cm^3'),
        'Type'                    : 'InfiniteCircularFiberGenerator',
        'UseDTex'                 : False,
        'DiameterDistribution' : {
          'Type'  : 'Constant', # Possible values: Constant, UniformlyInInterval, Gaussian, Table, LogNormal
          'Value' : 1e-05,
          },
        'OrientationDistribution' : {
          'Type'          : 'AnisotropicDirection',# Possible values: Isotropic, AnisotropicDirection, AnisotropicOrientation, GivenDirection, InXYPlane, AngleAroundDirection, UNDEF
          'DirectionMode' : 'AnisotropyParameter',# Possible values: AnisotropyParameter, DirectionTensor
          'Anisotropy1'   : 7,
          'Anisotropy2'   : 1,
          'Phi'           : 0,
          'Theta'         : 0,
          'Psi'           : 0,
          },
        },
      'Generator2' : {
        'Material' : {
          'Name'        : 'Glass',
          'Type'        : 'Solid', # Possible values: Fluid, Solid, Porous, Undefined
          'Information' : 'Fiber',
          },
        'Probability'             : 0.5,
        'SpecificWeight'          : (2.58, 'g/cm^3'),
        'Type'                    : 'InfiniteCircularFiberGenerator',
        'UseDTex'                 : False,
        'DiameterDistribution' : {
          'Type'  : 'Constant', # Possible values: Constant, UniformlyInInterval, Gaussian, Table, LogNormal
          'Value' : 6e-06,
          },
        'OrientationDistribution' : {
          'Type'          : 'AnisotropicDirection',# Possible values: Isotropic, AnisotropicDirection, AnisotropicOrientation, GivenDirection, InXYPlane, AngleAroundDirection, UNDEF
          'DirectionMode' : 'AnisotropyParameter',# Possible values: AnisotropyParameter, DirectionTensor
          'Anisotropy1'   : 5,
          'Anisotropy2'   : 1,
          'Phi'           : 0,
          'Theta'         : 0,
          'Psi'           : 0,
          },
        },
      'Temperature'              : (293.15, 'K'),
      }
    gd.runCmd("FiberGeo:Create", Create_args_1, Header['Release'])


def getConstituentMaterials(temp):
    SetTemperature_args_1 = {
      'Temperature' : (273.15+temp, 'K'),
      }
    gd.runCmd("GeoDict:SetTemperature", SetTemperature_args_1, Header['Release'])


    coMatDict = gd.getConstituentMaterials( Header['Release'] )
    coMatDict['ChosenFluid'] = {
      'Fluid' : 'Air',
      }
    return coMatDict


def getStokesPara(coMatDict, temp):
    SolveStokesDict = {
      'ResultFileName'       : 'StokesResult_T' + str(temp) + '.gdr',
      'ConstituentMaterials' : {},
      'SolverData' : {
        'DirectionEnabledX'  : 0,
        'DirectionEnabledY'  : 0,
        'DirectionEnabledZ'  : 1,
        'CharLengthMode'     : 'PERMEABILITY', # Possible values: PERMEABILITY, PORE_SIZE, FIBER_SIZE, USER_GIVEN
        'GivenCharLength'    : 1,
        'PressureDifference' : (0.02, 'Pa'),
        'MeanVelocity'       : (0.1, 'm/s'),
        'FlowRate'           : (60, 'l/min'),
        'FlowArea'           : (100, 'cm^2'),
        'ExperimentIO'       : 'PressureDrop',
        'AddInletOutlet'     : True,
        'InletLength'        : 10,
        'OutletLength'       : 10,
        'SlipLength'         : 0,
        'NormalBcType'       : 'Periodic',
        'TangentialBcYInX'   : 'Periodic',
        'TangentialBcZInX'   : 'Periodic',
        'TangentialBcXInY'   : 'Periodic',
        'TangentialBcZInY'   : 'Periodic',
        'TangentialBcXInZ'   : 'Periodic',
        'TangentialBcYInZ'   : 'Periodic',
        'Parallelization' : {
          'Mode' : 'LOCAL_MAX', # Possible values: Sequential, LOCAL_THREADS, LOCAL_MPI, LOCAL_MAX, CLUSTER, Undefined
          },
        'DiscardTemporaryFiles'   : False,
        'AnalyzeGeometry'         : True,
        'Restart'                 : 0,
        'RestartFileName'         : '',
        'RestartSaveIntervalTime' : 6,
        'UseTolerance'            : False,
        'Tolerance'               : 0.0001,
        'UseErrorBound'           : True,
        'ErrorBound'              : 0.01,
        'MaxNumberOfIterations'   : 100000,
        'MaximalSolverRunTime'    : (240, 'h'),
        'UseMaxIterations'        : False,
        'UseMaxTime'              : False,
        'UseLateral'              : False,
        'UseMultigrid'            : True,
        'Optimization'            : 'Speed',
        'GridType'                : 'LIR-Tree',
        'Relaxation'              : 1,
        'Refinement'              : 'ENABLED',   # Possible values: ENABLED, DISABLED, MANUAL
        'WriteCompressedFields'   : True,
        },
      }
    SolveStokesDict['ConstituentMaterials'] = coMatDict;
    return SolveStokesDict


# start main
createBaseGeo()

temp = 20.0 # Celsius
gd.runCmd( "FlowDict:SolveLIRStokes", getStokesPara( getConstituentMaterials( temp ), temp ), Header['Release'] )

temp = 50.0 # Celsius
gd.runCmd( "FlowDict:SolveLIRStokes", getStokesPara( getConstituentMaterials( temp ), temp ), Header['Release'] )

Pages: [1]