|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Fabian
Join Date: Apr 2023
Posts: 4
Rep Power: 3 ![]() |
Hello everybody,
I am trying to set up a simulation where a calculated value from an old time step is used to calculate the new value in the next time step. These values are no fields but single values. Is there a way to do that in Star CCM+ and if so how? I have tried using field histories but it seems that with these I can only access fields. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Join Date: Nov 2019
Posts: 94
Rep Power: 6 ![]() |
You could try using the Statistics report. I would set the Statistic to Mean and the Sample collection policy to Last N samples with N=1
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Fabian
Join Date: Apr 2023
Posts: 4
Rep Power: 3 ![]() |
Thank you very much for your idea. However it seems that with the statistics report you only get the value at the newest time. Instead you can get the value by using a statistics report of the last 2 time steps. So N = 2. Since you get a mean value you have to multiply it by 2 and subtract the newest value.
With this I had the issue that I can not update the latest value. I always had either a self or a circle reference. In the end it was possible using field functions and histories. The problem is that in the beginning of a simulation field histories seem to store nans. This means that when you create a field function like: y_new = y_old + 1, you always get nans. Even when you skip the first iterations using if functions the whole function becomes nan. Therefore you need to start the simulation with a fixed value and change it manually to the aforementioned function afterwards. Another problem was that you can not plot the values using reports directly since you have a field eventhough the values are the same everywhere. You can easily circumvent that using Max or Min reports. |
|
![]() |
![]() |
![]() |
![]() |
#4 | |
Member
Join Date: Nov 2019
Posts: 94
Rep Power: 6 ![]() |
You're right about the N=1 giving you the current value, I didn't realize that. But it should still be possible similarly to how you suggest doing it.
Quote:
Report1 = normal report of your quantity of interest (current value) Report2 = statistics report of the type Sum with last N = 2 Report3 = Expression report = ${Report2} - ${Report1} Shouldn't that do the trick? |
||
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Fabian
Join Date: Apr 2023
Posts: 4
Rep Power: 3 ![]() |
I didn't see your answer yet. Sorry for that.
So what I wanted to do was change a certain value using a value from the calculation. I wanted to update the set value each time step. Let's say for example I have a certain amount of particles (n) in a container. Each step a certain amount leaves the container (m). What I wanted to do was to get the new amount of particles by saying: n_old - m = n_new. Both of the ways we suggested with the sum and the mean give the old value. My problem occured afterwards though. I couldn't use the formula above for reports since it gave me a circle reference. But I managed to do it with field functions and field histories. So it is working now. Thanks for your help ![]() |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Postprocess: sampleDict works but creates no output folder | shock77 | OpenFOAM Post-Processing | 14 | November 15, 2021 08:27 |
Convergence problem of OF | WUYing | OpenFOAM Running, Solving & CFD | 2 | September 20, 2021 10:09 |
SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? | EternalSeekerX | SU2 | 3 | October 9, 2020 18:28 |
pimpleDyMFoam computation randomly stops | babapeti | OpenFOAM Running, Solving & CFD | 5 | January 24, 2018 05:28 |
dynamic Mesh is faster than MRF???? | sharonyue | OpenFOAM Running, Solving & CFD | 14 | August 26, 2013 07:47 |