-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
138 virtual boundary method for scalar fields #140
base: main
Are you sure you want to change the base?
138 virtual boundary method for scalar fields #140
Conversation
together with tests
We changed set fixed field kernels such that for both vector and scalar field function structures will be same.
apply ibm on scalar fields as well.
the typing problems in VirtualBoundaryForcing and its tests
forcing grid functinallity.
and tests are added.
temperature field
…://github.com/armantekinalp/SophT-Simulator into 138_virtual_boundary_method_for_scalar_fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments and questions. Make sure the CI is passed.
def scalar_field_set_fixed_val_pyst_kernel_2d(field, fixed_val): | ||
set_fixed_val_pyst_kernel_2d(field=field, fixed_val=fixed_val) | ||
|
||
return scalar_field_set_fixed_val_pyst_kernel_2d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this functionally different from before?
def scalar_field_set_fixed_val_pyst_kernel_3d(field, fixed_val): | ||
set_fixed_val_pyst_kernel_3d(field=field, fixed_val=fixed_val) | ||
|
||
return scalar_field_set_fixed_val_pyst_kernel_3d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as 2D comment.
@ps.kernel | ||
def _update_passive_field_from_forcing_stencil_2d(): | ||
passive_field, forcing_field = ps.fields( | ||
f"passive_field, forcing_field " f": {pyst_dtype}[{grid_info}]" | ||
) | ||
prefactor = sp.symbols("prefactor") | ||
passive_field[0, 0] @= passive_field[0, 0] + forcing_field[0, 0] * prefactor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use saxpy for this? It has an extra scalar multiplication but saves this file. Same for 3D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have a new class instead of using the passive transport class?
data_timer_limit = 0.25 * timescale | ||
drag_coeffs_time = [] | ||
drag_coeffs = [] | ||
nusslet_number_time = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 'nusselt' instead of 'nusslet' if you are referring to the Nusselt number. There seems to be 57 occurrences across the files.
import sopht.utils as spu | ||
import sys | ||
|
||
sys.path.append("/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this? This seems a bit dangerous. Same for the other files that have this
self.compute_lag_grid_position_field() | ||
self.compute_lag_grid_velocity_field() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should probably be abstracted somehow in a later fix considering we are doing this in every initialization even when not necessary. But okay for now.
This pull request expands the functionality of the virtual boundary method implemented in Sopht. It introduces support for scalar fields, enabling the simulation and manipulation of variables like temperature within the framework.
Solves #138
New features are