|
[Sponsors] |
August 27, 2008, 08:23 |
Hello
i want to have the psi
|
#1 |
New Member
Franz
Join Date: Mar 2009
Posts: 17
Rep Power: 17 |
Hello
i want to have the psi internal values of a previous time step to access them in the updateInterfaceMatrix function of my fvPatchField. The updateInterfaceMatrix has a parameter lduMatrix& which is the base class for the fvMatrix which has a function psi() to access the psi value. But i cannot cast the lduMatrix into the fvMatrix so my question is how to downcast from the const lduMatrix& to fvMatrix& is that possible in OpenFOAM framework ?. |
|
August 27, 2008, 08:36 |
You have to be a bit careful,
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
You have to be a bit careful, depending where the cast is, eg. you should probably be in templated code. Otherwise, it's easy:
psi().oldTime().internalField() Enjoy, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
August 27, 2008, 10:25 |
Thank you very much for the fa
|
#3 |
New Member
Franz
Join Date: Mar 2009
Posts: 17
Rep Power: 17 |
Thank you very much for the fast answer Mr Jasak,
in my case it is about the following method of a coupledFvPatchField derived class. initInterfaceMatrixUpdate ( const scalarField& psiInternal, scalarField&, const lduMatrix& matrix, const scalarField&, const direction, const bool bufferdTransfer ) const { // here i want to cast the lduMatrix down to the // fvMatrix i tried the following const fvMatrix<type>& test = dynamic_cast<const> >(matrix); } // const fvMatrix<type> in dynamic_cast braces // had problem to display in forum preview The compiler complains that : cannot dynamic_cast const lduMatrix& to const fvMatrix<type>& so i also tried to const_cast the lduMatrix reference with no improvement So right now i don't know how to access the old psi field within that method. The thing why i need that is because i am trying to implement a phase lag or direct storage method mentioned by Erdos, J. I. & Alzner, E. Computation of Unsteady Transonic Flows Through Rotating and Stationary Cascades I - Method of Analysis Nasa Contract Report 2900, 1977, 2900 So what i want to do is to store the psi field of one previous time step the geometric handling is all done only the storage is the remaining problem If you know a workaround for the template casting problem i would welcome that very much :-) |
|
August 27, 2008, 14:34 |
Hi Franz, The problem is that
|
#4 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Hi Franz, The problem is that you are trying to get this done at the wrong place. Explaining it in detail would be a lot of effort; in short, you need to go back to the (templated, coupled) boundary condition and do the work there.
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
August 27, 2008, 15:46 |
Sorry for that i think
i hav
|
#5 |
New Member
Franz
Join Date: Mar 2009
Posts: 17
Rep Power: 17 |
Sorry for that i think
i have typed it wrong it seems you are thinking that i am in the global function thats the header of my test class which is my boundary condition header { template<class> class test: public testLduInterfaceField, public coupledFvPatchField<type> } source { test::initInterfaceMatrixUpdate } Sorry for that strange notation But i thought i am in the ,as you called it, (templated, coupled) boundary condition The code at August 27, 2008 - 07:25 am is implemented in the class test which is a template and derived from coupledFvPatchField. Maybe i just misunderstood your words But again thank you for reply |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ensight - node values -cell values | leo | FLUENT | 1 | May 12, 2010 09:47 |
[Commercial meshers] TGridFluent mesh with internal by prism layer and internal face for diagnostic | sponiar | OpenFOAM Meshing & Mesh Conversion | 2 | March 30, 2009 16:02 |
how to get fluid internal internal energy | vbk | FLUENT | 0 | December 17, 2007 02:54 |
node values or cell values? | aPpA | FLUENT | 0 | November 10, 2006 09:56 |
Internal BC | Saud Khashan | FLUENT | 0 | July 3, 2001 09:58 |