Adding new parameters and auto fill them in the constructor
Hello OpenFOAM users,
I've got a question on some coding I did recently and what I haven't been able to get to work yet. In our team we are doing a simulation of particles moving in a solution through a tube. We reworked one of the lagrangian solvers (I'm afraid I cannot tell you which one it is atm, but that doesn't go into account too much) and implemented a dielectrophoretic force, that eventually stops the particles moving in the solution. So far everything goes fine, the particles really stop moving at the desired point, but now I want to implement a little if query that makes the solver stop trying to move the particle, when it hasn't moved for the last 3 steps. Therefore i could reduce the amount of calculation needed for the simulation. So I did the following: in the src/lagrangian/basic/particle library I added in particle.H in Code:
public: Code:
//- Flag to stop particle from moving without deleting Code:
//- List of last 3 positions In the particle.C file I added in every constructor: Code:
positionHistory_ When I try to compile this, i get the output: particle/particle.C:68:2: error: expected ‘)’ before numeric constant 0.0 But even if I put brackets around the scalars nothing changes on the error message. Thats been a lot of text so far, but I hope you will be able to help me. Greetings BD |
Does your version of code have:
FixedList.H Code:
//- Construct from value I don't know of any easy way to initialise a list in one line. atomicWeights.C does something like this, though. You could also create a static function that returns a fixedList with 0.0 set for all elements, and call that in the constructor initialisation list for each constructor. |
All times are GMT -4. The time now is 07:11. |