- #1
hoomanya
- 90
- 0
I am modelling a 1D fluid wave propagation problem and I needed to know how I can check that my results are energy conservative. please reply, urgent. thank you.
phyzguy said:if the density of cell i is given by [itex]\rho_i[/itex], and the velocity is given by [itex]u_i[/itex], then if you take the total [itex]\frac{1}{2} \sum_i{ \rho_i u_i^2}[/itex], then this should be conserved. Of course, your simulation might have other things, like gravitation, in which case you would need to add in the gravitational potential energy as well.
thanks, I'm using finite volume. my problem is transient.Chestermiller said:You are using a finite difference scheme, and you want to know if the finite difference scheme automatically conserves energy, correct?
Does your finite difference scheme automatically conserve energy (i.e., is this a mathematical characteristic of your finite difference equations)?hoomanya said:thanks, I'm using finite volume. my problem is transient.
I'm not sure. What do you mean by automatically? You mean by formulation? so if I add the discretised terms, the terms at the internal boundaries cancel out and I'm left with the terms at the two left and right boundaries.Chestermiller said:Does your finite difference scheme automatically conserve energy (i.e., is this a mathematical characteristic of your finite difference equations)?
Chet
The latter.hoomanya said:I'm not sure. What do you mean by automatically? You mean by formulation? so if I add the discretised terms, the terms at the internal boundaries cancel out and I'm left with the terms at the two left and right boundaries.
hoomanya said:thank you. do I take the total over the cells, so say I have 10 cells, I add the kinetic energy term over for the 10 cells and show that they equal zero? what about time?
Thanks alot. Does the type of boundary condition used have any influence in this?phyzguy said:Yes, you add the kinetic energy for all of the cells. It won't necessarily equal zero, but it should be the same value at each time step, assuming no energy is flowing in or out of the boundaries. As chestermiller says, you could examine the equations that propagate the fluid quantities from the current time step to the next time step. These should automatically conserve the conserved quantities (mass, momentum, energy), because they should just move these quantities from one cell to an adjacent cell.
Hi, thanks again. Not quite sure, I think by integrating du = -p dv which I am guessing will give u - u_0 = -p (v-v_0), but not quite sure what the specific volume will be. I am guessing that's where density comes in.phyzguy said:Right. I should have said this earlier. It is the total energy that is conserved, so you need to include the internal energy. The internal energy will be decreasing as your initial fluid pulse expands. Do you know how to calculate the internal energy? If so, you should add this to the KE and plot the total energy.
I'm not sure what you mean by a continuum model. I am not using a differential energy balance equation.Chestermiller said:Is this a continuum model? If so, the differential energy balance equation should already involve the internal energy. Please write the differential energy balance equation you are using.
Chet
hoomanya said:Hi, thanks again. Not quite sure, I think by integrating du = -p dv which I am guessing will give u - u_0 = -p (v-v_0), but not quite sure what the specific volume will be. I am guessing that's where density comes in.
I am solving the isothermal Euler equations and relating pressure to density using the bulk modulus of the material. I have an initial density (and hence pressure) wave and initial velocity is zero.phyzguy said:What are the fluid variables that are carried at each point in the code? You should have access to either the internal energy, or to a temperature and/or pressure from which you can calculate the internal energy. Your code must have equations for calculating the fluid variables at time t+δt in terms of the variables at time t. Do you have access to these equations?
hoomanya said:I am solving the isothermal Euler equations and relating pressure to density using the bulk modulus of the material. I have an initial density (and hence pressure) wave and initial velocity is zero.
phyzguy said:Well, I'm not 100% certain, but I think what you are saying does not make physical sense. You start with a fluid with an initial density and pressure. The fluid expands and drives a wave in both directions. The kinetic energy of the waves must come from the internal energy of the fluid. So the fluid cannot be isothermal. The temperature has to decrease as the wave expands. At least, this is how it seems to me.
I was thinking of the fundamental equation of thermodynamics and how Tds = du - pdvphyzguy said:So if why you are saying is correct, where does the kinetic energy of the waves come from?
thanks very much for your help this far.phyzguy said:I just don't know the answer. Maybe you are right, but I'm not sure.
Energy conservation in numerical simulations refers to the principle that the total energy of a system should remain constant over time. This means that the energy input into the system should be equal to the energy output, and there should be no energy losses within the simulation.
It is important to check for energy conservation in numerical simulations because it ensures that the simulation accurately represents the real-world system. Energy conservation is a fundamental law of physics, and violations of this law in a simulation can lead to inaccurate results and predictions.
One way to check if a numerical simulation is energy conservative is by comparing the total energy of the system at different time steps. If the total energy remains constant, then the simulation is likely energy conservative. Another method is to use energy conservation equations and compare the energy inputs and outputs within the simulation.
Some common sources of energy losses in numerical simulations include numerical errors, model simplifications, and boundary conditions. These can lead to inaccuracies in the simulation and result in energy losses.
No, it is almost impossible for a numerical simulation to be perfectly energy conservative. This is because there will always be some level of numerical error and simplifications in the model that can lead to energy losses. However, efforts can be made to minimize these errors and ensure that the simulation is as energy conservative as possible.