WIP: Fluctuating Equations non-normalized
Non normalized equations for the variances.
Still need to figure out how to get lattice spacing and whether definition for mu should contain lattice time as well.
Related to walberla/walberla!220 (merged) and implements/enhances #2 (closed)
Merge request reports
Activity
Related to walberla/walberla!220 (merged)
Edited by Felix Winterhalteradded 3 commits
- Resolved by Michael Kuron
- Resolved by Felix Winterhalter
329 326 variances = SymbolGen("variance") if params['fluctuating'] is True else params['fluctuating'] 330 327 correction = fluctuation_correction(lb_method, random_symbol(collision_rule.subexpressions, dim=lb_method.dim), 331 328 variances) 329 332 330 for i, corr in enumerate(correction): 333 331 collision_rule.main_assignments[i] = Assignment(collision_rule.main_assignments[i].lhs, 334 332 collision_rule.main_assignments[i].rhs + corr) 335 333 334 variances = SymbolGen("variance") if params['fluctuating'] is True else params['fluctuating'] 335 temperature = sp.Symbol("fluctuating_temperature") if params["temperature"] is None else params["temperature"] 336 variance_equations = fluctuating_variance_equations(method=lb_method, 337 temperature=temperature, 338 c_s_sq=params["c_s_sq"], 339 variances=variances) changed this line in version 8 of the diff
added 1 commit
- ff1b76c5 - Only generate variance equations if temperature is set
326 323 collision_rule = simplification(collision_rule) 327 324 328 325 if params['fluctuating']: 329 variances = SymbolGen("variance") if params['fluctuating'] is True else params['fluctuating'] 326 variances = [v for v, _ in zip(iter(SymbolGen("variance")), lb_method.moments)] if params['fluctuating'] is True else params['fluctuating'] 330 327 correction = fluctuation_correction(lb_method, random_symbol(collision_rule.subexpressions, dim=lb_method.dim), 331 328 variances) 329 332 330 for i, corr in enumerate(correction): 333 331 collision_rule.main_assignments[i] = Assignment(collision_rule.main_assignments[i].lhs, 334 332 collision_rule.main_assignments[i].rhs + corr) 335 333 334 temperature = sp.Symbol("fluctuating_temperature") if params["temperature"] is None else params["temperature"] I don't like the name "fluctuating_temperature". Of course it is the temperature of the fluctuating LB, but the name sounds like it's a bool that specifies whether you want the temperature to fluctuate or not. Why not just name it "temperature"? It's unlikely any future modification will ever require specifying separate temperatures for the LB method and for the fluctuation algorithm, so the distinction is not needed.
I'm a bit hesitant to just name it
temperature
. How about passing a dict as thefluctuating
parameter if additional options are required?Is it correct that one can either pass variance values or temperature values? Could the user also just call
create_lb_*(fluctuating=variance_expressions_from_temperature(temperature))
assigned to @bauer and unassigned @winterhalter
mentioned in merge request pystencils!23 (closed)