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/)
-   -   Complex geometric fields (https://www.cfd-online.com/Forums/openfoam-programming-development/189461-complex-geometric-fields.html)

Ali Blues June 20, 2017 10:05

Complex geometric fields
 
Hi ,
It’s been years since the last comment (from Henrik) I’ve seen on GeometricFields of complex numbers:
https://www.cfd-online.com/Forums/op...x-numbers.html

I think it’s about time that this functionality is added to OpenFOAM, since there are many physical problems which can be solved in frequency domain such as acoustics which require performing differential operations on complex variables and solving for complex GeometricFields. Henry mentioned that this extension is not a great deal of work, but I’m afraid it is for someone which does not have years of experience with C++ and OpenFOAM. I would like to look into this but need some guidance.

Since we already have the complexVectorField, then questions is how to put it as a parent class for the geometricField<Type>. Or do I have to define an entire set of classes leading to “geometricComplexField<Type>”?

Also do I need to define how differential (fvm or fvc of div, grad) are carried out for complex numbers?

Also the iterative solvers, I hope I don’t need to make modifications there, or do I?

Thanks,
Ali

wyldckat January 1, 2018 17:51

Quote:

Originally Posted by Ali Blues (Post 654164)
Since we already have the complexVectorField, then questions is how to put it as a parent class for the geometricField<Type>. Or do I have to define an entire set of classes leading to “geometricComplexField<Type>”?

Quick answer: There is no need to create “geometricComplexField<Type>”, the correct definitions would be something like:
Code:

geometricField<complex>
geometricField<complexVector>

Although it seems like the non-complex vector is not used anymore... see here: https://github.com/OpenFOAM/OpenFOAM...metricFields.H

Start looking in the following folder for ideas: https://github.com/OpenFOAM/OpenFOAM...eometricFields
I believe you need to replicate whatever is done with "GeometricScalarField" with the respective "GeometricComplexField" alternative.

After that, you would have to look into this folder: https://github.com/OpenFOAM/OpenFOAM...e/finiteVolume
But from what I can quickly see, it seems like you don't need to worry about this part, because C++ templates will create the respective instances when needed.


All times are GMT -4. The time now is 12:25.