You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying to solve the convection and conduction in 1 D problem. it solves and produce irrelevant results. Has anyone tried this before ? At one end we are defined flux (h* T_inf-T0) and other end is adiabatic. Moreover , it takes huge amount of time. Results we have got it's on the power of 9 which is irrelevant. Please mention your comments , if anyone tried or know how it actually works.
import openpnm as op
net = op.network.Cubic(shape=[5 1, 1], spacing=0.001, 1, 1])
Define time
tspan = np.linspace(x0= 300, tspan = [0,100])
for i in range(1, n_steps):
sim.run(x0=phase['pore.temperature'], tspan=[tspan[i-1], tspan[i]])
T_results[i, :] = sim['pore.temperature'] # Store results
Plot the results
plt.figure(figsize=(10, 6))
for i in range(N_pores):
plt.plot(tspan, T_results[:, i], label=f'Pore {i}')
plt.xlabel('Time (s)')
plt.ylabel('Temperature (K)')
plt.legend()
plt.title('Temperature Profiles in Porous Media')
plt.show()
This discussion was converted from issue #2962 on March 31, 2025 17:56.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am trying to solve the convection and conduction in 1 D problem. it solves and produce irrelevant results. Has anyone tried this before ? At one end we are defined flux (h* T_inf-T0) and other end is adiabatic. Moreover , it takes huge amount of time. Results we have got it's on the power of 9 which is irrelevant. Please mention your comments , if anyone tried or know how it actually works.
import openpnm as op
net = op.network.Cubic(shape=[5 1, 1], spacing=0.001, 1, 1])
ax = op.visualization.plot_coordinates(net)
ax = op.visualization.plot_connections(net, ax=ax)
Add geometry models
net.add_model_collection(op.models.collections.geometry.spheres_and_cylinders)
net.regenerate_models()
phase = op.phase.Phase(network=net)
Assign material properties to the phase
phase['throat.thermal_conductivity'] = 0.2 # Thermal conductivity (W/mK)
phase['pore.density'] = 700 # Density (kg/m^3)
phase['pore.specific_heat'] = 500 # Specific heat capacity (J/kgK)
phase.add_model(propname='throat.thermal_conductance',
model=op.models.physics.thermal_conductance.series_resistors)
algorithm
sim = op.algorithms.TransientFourierConduction(network=net, phase=phase)
Set initial conditions
T_initial = 300 # K
phase['pore.temperature'] = T_initial
Set boundary conditions
T_external = 1173 # K
h = 200 # W/m²K
left_pores = net.pores('left')
right_pores = net.pores('right')
sim.set_rate_BC(pores=left_pores, rates=h * (T_external - T_initial), mode='overwrite')
sim.set_rate_BC(pores=right_pores, rates=0, mode='overwrite') # Adiabatic condition
Define time
tspan = np.linspace(x0= 300, tspan = [0,100])
for i in range(1, n_steps):
sim.run(x0=phase['pore.temperature'], tspan=[tspan[i-1], tspan[i]])
T_results[i, :] = sim['pore.temperature'] # Store results
Plot the results
plt.figure(figsize=(10, 6))
for i in range(N_pores):
plt.plot(tspan, T_results[:, i], label=f'Pore {i}')
plt.xlabel('Time (s)')
plt.ylabel('Temperature (K)')
plt.legend()
plt.title('Temperature Profiles in Porous Media')
plt.show()
Beta Was this translation helpful? Give feedback.
All reactions