Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Command order in Dynamics.R #112

@mdzik

Description

@mdzik

I found that Dynamics.R compilation is not working

this works fine:

AddDensity( name="f[0]", dx= 0, dy= 0, group="f")
#....

AddDensity( name="h[0]", dx= 0, dy= 0, group="h")
#....

AddDensity( name="h_Z", dx=0, dy=0, group="HZ")

AddField( name="nw_x", stencil2d=1, group="nw")
AddField( name="nw_y", stencil2d=1, group="nw")
AddField("phi"      ,stencil2d=1 );

AddStage("BaseIteration", "Run", 
         load=DensityAll$group == "f" | DensityAll$group == "h"| DensityAll$group == "HZ",  
         save=Fields$group=="f" | Fields$group=="h" | Fields$group=="nw" | Fields$group == "HZ"
         ) 
AddStage("CalcPhi", 
         save=Fields$name=="phi" ,  
         load=DensityAll$group == "h"
         )
AddStage("BaseInit", "Init",  save=Fields$group=="f" | Fields$group=="h"| Fields$group == "HZ") 
AddStage("CalcWallNormall", "CalcNormal",   
         save=Fields$group=="nw",
         fixedPoint=TRUE
         ) 

AddAction("Iteration", c("BaseIteration","CalcPhi"))
AddAction("Init", c("BaseInit","CalcPhi", "CalcWallNormall"))

but if you change order, eq:

AddDensity( name="f[0]", dx= 0, dy= 0, group="f")
#....

AddField( name="nw_x", stencil2d=1, group="nw") # <<<<<<<<

AddDensity( name="h[0]", dx= 0, dy= 0, group="h")
#....
AddDensity( name="h_Z", dx=0, dy=0, group="HZ")

solver brakes, and h_Z does not gets "advected" with zero-zero velocity through iterations.

Possible fixes:

  1. fix the problem itself, but for AddStage it might require some sort of delayed compilation ;)
  2. AddDensity called AFTER AddField should cause compilation error. This must be implemented for all Add* functions where order matters.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions