I’m seeking advice on methods for performing time-dependent data assimilation.
I have concentration distribution data at each time step, which I intend to read into Modulus for data assimilation. While the example in heat_sink_inverse.py for assimilating steady-state data was very helpful, I’m unsure how to extend this to assimilate data containing time-dependent information. Could someone please assist me with this? Thank you.
Below is the section of code from heat_sink_inverse.py where data is read and constraints are applied. I would like to expand this to include time-dependent data:
code example in heat_sink_inverse.py
file_path = “openfoam/heat_sink_Pr5_clipped2.csv”
if not os.path.exists(to_absolute_path(file_path)):
warnings.warn(
f"Directory {file_path} does not exist. Cannot continue. Please download the additional files from NGC <TODO: Add link here>"
)
sys.exit()
mapping = {
“Points:0”: “x”,
“Points:1”: “y”,
“U:0”: “u”,
“U:1”: “v”,
“p”: “p”,
“T”: “c”,
}
openfoam_var = csv_to_dict(
to_absolute_path(“openfoam/heat_sink_Pr5_clipped2.csv”), mapping
)
openfoam_var[“c”] = openfoam_var[“c”] / base_temp - 1.0
openfoam_invar_numpy = {
key: value for key, value in openfoam_var.items() if key in [“x”, “y”]
}
openfoam_outvar_numpy = {
key: value for key, value in openfoam_var.items() if key in [“u”, “v”, “p”, “c”]
}
openfoam_outvar_numpy[“continuity”] = np.zeros_like(openfoam_outvar_numpy[“u”])
openfoam_outvar_numpy[“momentum_x”] = np.zeros_like(openfoam_outvar_numpy[“u”])
openfoam_outvar_numpy[“momentum_y”] = np.zeros_like(openfoam_outvar_numpy[“u”])
openfoam_outvar_numpy[“advection_diffusion_c”] = np.zeros_like(
openfoam_outvar_numpy[“u”]
)
data = PointwiseConstraint.from_numpy(
nodes=nodes,
invar=openfoam_invar_numpy,
outvar=openfoam_outvar_numpy,
batch_size=cfg.batch_size.data,
)
domain.add_constraint(data, “interior_data”)