update_node

15 views
Skip to first unread message

Mohammadreza Alipour

unread,
Aug 3, 2022, 1:06:56 PM8/3/22
to sailfish-cfd
How can I change the boundary conditions during simulation?
The update_node function doesn't work for me? How shoud I use it? may I have a example for this?

Thanks
Reza

Mohammadreza Alipour

unread,
Aug 3, 2022, 1:06:56 PM8/3/22
to sailfish-cfd
Hi 

Could you please help me with a changing boundary condition during simulation? 
It has been mentioned that the "update_node" do this but it seems not working.

class LDCSim(LBFluidSim):
    subdomain = LDCBlock  # DuctSubdomain

    @classmethod
    def update_defaults(cls, defaults):
        defaults.update({
            'lat_nx': 128,
            'lat_ny': 64,
            'lat_nz': 64,
            'grid': 'D3Q19'})

    prev_f = None
    every = 500
    def after_step(self, runner):
        if self.iteration % self.every == 0:
            wallBC = NTFullBBWall 
            hx, hy, hz = runner._subdomain._get_mgrid()
            whr = (np.square(hx - 80) + np.square(hy - 16) + np.square(hz - 32)) <= np.square(8)
            runner._subdomain.update_node(whr,wallBC)

Reply all
Reply to author
Forward
0 new messages