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/)
-   -   angularDisplacement timeVarying Boundary (https://www.cfd-online.com/Forums/openfoam-programming-development/94626-angulardisplacement-timevarying-boundary.html)

Aurelien Thinat November 21, 2011 11:39

angularDisplacement timeVarying Boundary
 
Hello everybody,

I'm trying to develop my first boundary condition. I have to mix the angularOscillatingDisplacement boundary and the timeVaryingUniformFixedValue boundary.

I have a file with 2 columns : 1 = time | 2 = angle.

So I take a look at the existing boundary condition and I was thinking about modifying the angularOscillatingdisplacement into an angularFileDisplacement.
-> If somebody can confirm me it's not a so bad idea.

Then, I looked at the forum, and I found a post about "g time varying". In this thread they said it's possible to use an interpolation table.

So correct me if I am wrong, I have to :
- delete every fields like "amplitude" and "omega" which are useless now
- create an "interpolationTable<Type> timeSeries_;"
- rename each "angularOscillatingDisplacement" by "angularFileDisplacement",
- modify the formula to compute the scalar "angle".

Regards,
Aurélien

Aurelien Thinat November 22, 2011 04:45

So I have started the above developement. And I wonder how the interpolationTable works.
I have written :
Quote:

(...)
timeSeries_(dict.lookup("file"))
(...)
scalar angle = timeSeries(runTime.value());
(...)
And runTime.value() is not compiling. So i take a look at timeVaryingUniformFixedValueFvPatchField.C and I found that line, which I presume is the call to the interpolationTable :

Quote:

if (this->upadated())
{
return;
}

fvPatchField<Type>:: operator==
(
timeSeries_(this->db().time().timeOutputValue())
);
fixedValueFvPatchField<Type>::updateCoeffs();

Could you explain me what does it means please ? Especially the "this->db().time().timeOutputValue()).
Thank you.

EDIT : I finally didn't use the interpolationTable function. I just open an IF stream from the file I wanted and make the BC reads the Data by myself. I still interested by any answer about my last question.


All times are GMT -4. The time now is 13:07.