Skip to content

Conversation

@aminrai2000
Copy link

Solves the following issue(s):

None

Core changes:

  • New routine eval_velocity in particles base class
  • Added corresponding unit test in 1d

Model-specific changes:

None

Documentation changes:

None

@aminrai2000 aminrai2000 requested a review from spossann November 6, 2025 14:01
@spossann spossann marked this pull request as ready for review November 6, 2025 14:56
spossann
spossann previously approved these changes Nov 6, 2025
@spossann spossann requested a review from max-models November 6, 2025 14:57

if n_xyz is None:
n_xyz = lambda x, y, z: 0.0 * x
n_xyz = lambda x, y, z: 1.0 + 0.0 * x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
n_xyz = lambda x, y, z: 1.0 + 0.0 * x
n_xyz = lambda x, y, z: np.ones_like(x, dtype=float)


if p_xyz is None:
p_xyz = lambda x, y, z: 0.0 * x
p_xyz = lambda x, y, z: 1.0 + 0.0 * x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
p_xyz = lambda x, y, z: 1.0 + 0.0 * x
p_xyz = lambda x, y, z: np.ones_like(x, dtype=float)

@spossann
Copy link
Member

spossann commented Nov 7, 2025

Hi @aminrai2000, could you please add the requested changes, push and then request review from me?

git checkout devel
git pull
git checkout euler-sph-normalization-clean
git pull
git merge devel

There should not be any conflicts.
Then commit your changes and git push. Thx!

@aminrai2000
Copy link
Author

Hi @aminrai2000, could you please add the requested changes, push and then request review from me?

git checkout devel
git pull
git checkout euler-sph-normalization-clean
git pull
git merge devel

There should not be any conflicts. Then commit your changes and git push. Thx!

Hi Stefan.
yes going to work on it today

Comment on lines 1119 to 1138
def u_eta(eta1, eta2, eta3):
u1 = 1 / Lx * xp.cos(2 * xp.pi * l1 / Lx + 2 * xp.pi * eta1) * xp.cos(2 * xp.pi * eta2 + 2 * xp.pi * l2 / Ly)
u2 = 1 / Ly * xp.cos(2 * xp.pi * l1 / Lx + 2 * xp.pi * eta1) * xp.cos(2 * xp.pi * eta2 + +2 * xp.pi * l2 / Ly)
u3 = 0.0 * z
return (u1, u2, u3)

# derivatives:
# derivative == 1 -> ∂/∂e1
# derivative == 2 -> ∂/∂e2
def du_dx(x, y, z):
dux = -2 * xp.pi / Lx * xp.sin(2 * xp.pi / Lx * x) * xp.cos(2 * xp.pi / Ly * y)
duy = -2 * xp.pi / Lx * xp.sin(2 * xp.pi / Lx * x) * xp.cos(2 * xp.pi / Ly * y)
duz = 0.0 * z
return (dux, duy, duz)

def du_dy(x, y, z):
dux = -2 * xp.pi / Ly * xp.cos(2 * xp.pi / Lx * x) * xp.sin(2 * xp.pi / Ly * y)
duy = -2 * xp.pi / Ly * xp.cos(2 * xp.pi / Lx * x) * xp.sin(2 * xp.pi / Ly * y)
duz = 0.0 * z
return (dux, duy, duz)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be deleted.

Comment on lines 1257 to 1258
v1_e, v2_e, v3_e = du_deta1(ee1, ee2, ee3)
v1, v2, v3 = v_log
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be removed, as it is already done above. If you overwrite here, the Allreduce will not be performed and the mpi tests will fail.

Comment on lines 1263 to 1264
v1_e, v2_e, v3_e = du_deta2(ee1, ee2, ee3)
v1, v2, v3 = v_log
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must also be removed, as above

Comment on lines 1336 to 1340
assert err_ux < 0.8709
assert err_uy < 0.8709
else:
assert err_ux < 0.716
assert err_uy < 0.716
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must choose test parameters such that these error get at least below 0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants