CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   acceleration.dat in interfoam (https://www.cfd-online.com/Forums/openfoam-programming-development/150831-acceleration-dat-interfoam.html)

13msmemusman March 30, 2015 11:24

acceleration.dat in interfoam
 
I tried to specify acceleration from file acceleration.dat file. but there is a problem. solver gets only first value of acceleration and after that it dont read acceleration.dat file. i added following code in interfoam creatFields.h

// Read the data file and initialise the interpolation table
interpolationTable<vector> timeSeriesAcceleration
(
runTime.path()/runTime.caseSystem()/"acceleration.dat"
);
g.value() = timeSeriesAcceleration(runTime.value());

i know creatFields.H is read just once. and i have to update g.value at each time step.... but the problem is how to do it..... i have tried by adding while loop in creatFields for g.value() but it doesnt work. as you said creatFields is read only once. if i take out g.value form creatFields.H and place it in interFoam g.value does not replace g vector specified in constants directory of the case. please suggest if you have an idea.....

please try and help me too......


All times are GMT -4. The time now is 04:22.