Hello,
In the context of developing a wall model, I have been writing my own boundary condition files involving preliminary computations within the prepare method. Specifically, I have been having trouble identifying where I can access the flux point physical coordinate data (for defining a wall-normal height as a function of the flux point’s xyz, its normal vector, and a scalar). Could you point me to which variable stores this information?
Additionally, do you have any suggestions for how to monitor the value of specific variables such as wall normal vectors? Aside from the writer plugin that outputs certain field values to file, I’m unsure how to explicitly “print” values for the purpose of debugging/verification.
As an update to this topic,
I have established the current method for referencing flux point coordinate data and can narrow down my confusion to more direct questions.
Instead of broadcasting a uniform value to all points, how can an array of values be assigned/scattered to the flux points on the boundary (i.e. allow for each flux point to have a unique value based on the elements of an array)?
I have added my custom array to the “externs” of the corresponding .mako file but am unsure how to handle the “scattering” on the .mako side of things if that is at all necessary.
class NavierStokesEqFcV1BCInters(NavierStokesBaseBCInters):
type = 'eq-fc-v1'
cflux_state = 'ghost'
def __init__(self, be, lhs, elemap, cfgsect, cfg):
super().__init__(be, lhs, elemap, cfgsect, cfg)
# Setting up flux point coordinate data
spec = f'in fpdtype_t[{self.ndims}]'
value = self._const_mat(lhs, 'get_ploc_for_inter')
self._set_external('ploc', spec, value=value)
#Shape for one value per flux point
fc_shape = (1,value.shape[1])
# Custom value function
self.fc_soln = be.matrix((fc_shape),tags = {'align'}, dtype = be.fpdtype)
self._set_external('fc_soln',f'in fpdtype_t[{fc_shape[0]}][{fc_shape[1]}]',value=self.fc_soln)
def prepare(self,t):
custom_vals = self.fc_soln.get()
custom_vals[0,:] = 1 # arbitrary value
self.fc_soln.set(custom_vals)
Edit:
I have resolved the issues I have been having.