openFoam syntax
hi openFoamer
in compressibleInterFoam and in pEqn.H there are following syntax: Code:
dgdt = pEqnComp : fvScalarMatrix p : volScalarField so whats "&" here ? |
I think it's the inner product.
|
im confused how we can inner product fvScalarMatrix with volScalarField?
what is the output and how this calculation can be done? give me a mathematical concept please :) |
fvMatrix.C implements operator& around line 2270. The result is a GeometricField. I'm not exactly sure what it does, but it looks like it affects the matrix. I don't have my Foaming computer in front of me at the moment.
|
& operator is defined in fvMatrix.C like below:
Code:
template<class Type> it seems it loops over the field to make it diagonal predominate, but its confusing! 2)why it returns tMphi while it does all operation on Mphi? i feel it should be Mphi |
add 2) tMphi is a tmp<Type>, whereas Mphi (of type Type) is a reference to tMphi. Hence all changes to Mphi is directly a change to tMphi.
tMphi is returned, as the tmp class is included in OpenFOAM to optimise the memory handling. Since volFieldsType> can potentially be very large, the return of a tmp<volField<Type> > speeds up the run-time. Kind regards, Niels |
It's probably the inner product. When it involves a fvMatrix, it apparently does something to the Matrix's diagonal. I'm not going to try to decode it because I agree: it is confusing.
|
Hi Nima, sorry for being dismissive in the last response. If you want to go into detail about what the & operator does, I've added some comments in blue that might help you out. It looks like it doesn't actually affect the matrix. It looks like it is the inner product between the field associated with the matirx, with the field p you mention. Since a matrix is involved, it has to account for boundary conditions, and I think that's where it gets confusing, especially when it comes to boundary patches that have out-of-core multiplication (cyclic, processor, etc). Also see below for links to useful pages that might help further explain things.
Code:
template<class Type> http://openfoamwiki.net/index.php/Op...ide/H_operator For what tmp<> is all about, see here: http://openfoamwiki.net/index.php/OpenFOAM_guide/tmp |
All times are GMT -4. The time now is 14:18. |