CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Does anyone work with curl in OpenFoam (https://www.cfd-online.com/Forums/openfoam-solving/59823-does-anyone-work-curl-openfoam.html)

evgenii December 15, 2005 05:07

Hi, all. Does anyone work wit
 
Hi, all.
Does anyone work with curl in OpenFoam?
I have some problems with it.
Hope to get some help or advice.

I wrote:

solve(
mu0*fvm::ddt(E)
+ fvc::curl(H)
);

solve(
epsilon0*fvm::ddt(H)
+ fvc::curl(E)
);


E,H - volVectorField, mu0, epsilon0 - dimensionedScalar

When I try to compile following error appears:
no matching function to call for solve(...)

Where am I mistaken?
Thank you.
Eugene

galaad December 15, 2005 05:17

Hello Eugene, Did you try f
 
Hello Eugene,

Did you try fvm instead of fvc:

solve(
mu0*fvm::ddt(E)
+ fvm::curl(H)
);

I think it's not a problem with curl but a syntax problem. Had you also define the equation to solve... for example:

tmp<fvvectormatrix> EEqn
(
mu0*fvm::ddt(E)
+ fvm::curl(H)
);
EEqn().relax();
EEqn().solve();

Try this and tell me :-).

Fred

galaad December 15, 2005 05:22

Or this... tmp
 
Or this...

tmp<fvvectormatrix> EEqn
(
mu0*fvm::ddt(E)
==
- fvc::curl(H)
);
EEqn().relax();
EEqn().solve();

The variable to solve in the left part of the equation and the source term on the right one.

Fred

evgenii December 15, 2005 05:31

Thank you so much! It's now co
 
Thank you so much! It's now compiling succesfully http://www.cfd-online.com/OpenFOAM_D...part/happy.gif (How it works I'll know later http://www.cfd-online.com/OpenFOAM_D...part/happy.gif )
There is only fvc::curl, there's no fvm::curl.
But you are right, I needed to define an equation in manner you gave.

hjasak December 15, 2005 05:54

Curl only comes in the explici
 
Curl only comes in the explicit version (fvc) because the implicit one couples the components of the vector. The current matrix support cannot handle that but the new version (block matrix) will come in due course). So, there's no fvm::curl at the moment.

As for the calculation of the curl, have a look at fvcCurl.C. There are two implementations

- the one based on the Gauss Theorem is commented out.

- the one with the Hodge dual is active and allows you to use your favourite gradient calculation algorithm

Enjoy,

Hrv

galaad December 15, 2005 06:06

Thanks Hrv for your comment an
 
Thanks Hrv for your comment and your advices http://www.cfd-online.com/OpenFOAM_D...part/happy.gif.

evgenii December 15, 2005 06:44

Thank for comments Hrv, it is
 
Thank for comments Hrv, it is very useful as usual

gort February 14, 2007 11:31

Hi all, i am trying to implem
 
Hi all,
i am trying to implement the following equation in the solver
curl(B)=mu0*j
B and j are volVectorField and mu0 is dimensionedScalar
mu0 and j are known.
Corresponding entry in the solver is
solve (fvc::curl(B)==mu0*j)
The "response" of compiler is
error: no match for 'operator==' in 'Foam::fvc::curl(const Foam::GeometricField<type,>&) [with Type = Foam::Vector<double>]() == 0'
/shared/home/gort//OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/cellModelI.H:124 : note: candidates are: bool Foam::operator==(const Foam::cellModel&, const Foam::cellModel&)
/shared/home/gort//OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/edgeI.H:147: note: bool Foam::operator==(const Foam::edge&, const Foam::edge&)

What is the right FOAM syntax for this equation? Will be happy for any advises.

Best regards,
Sergej

mvoss October 15, 2010 11:30

hi,

since this is looong time ago... did you managed to solve your curl(B)=mu0*j with OF ??

neewbie

makaveli_lcf April 11, 2018 04:10

Dear Hrv,
is there a point why Hodge dual is taken in favour of the Gauss reconstruction of curl?
Thank you in advance!
Best regards,
Sasha

Quote:

Originally Posted by hjasak (Post 201587)
Curl only comes in the explicit version (fvc) because the implicit one couples the components of the vector. The current matrix support cannot handle that but the new version (block matrix) will come in due course). So, there's no fvm::curl at the moment.

As for the calculation of the curl, have a look at fvcCurl.C. There are two implementations

- the one based on the Gauss Theorem is commented out.

- the one with the Hodge dual is active and allows you to use your favourite gradient calculation algorithm

Enjoy,

Hrv


Kummi January 23, 2020 04:14

Hello Foamers,
It's been a long while - however I have some query related to this thread !!

I am working with curl operator. My equation looks like:
\bigtriangledown \times \vee - \vee \times\bigtriangledown\left [   ln\left ( f_{1}+f_{2}\left | \rho U \right | \right ) \right ] = 0
And for this equation, I written the matrix structure as,
Quote:

{
fvVectorMatrix UEqn
(
dummy*(fvm::ddt(U)) // (1) fvm::ddt(U) // ADDITIONAL implicit term - helps in compilation
+ (fvc::curl(U)) // (2)
- ((U^gradU)/(0.4343*(God))) // (3) volScalarField God = f1+(f2*rho*mag(U)); volVectorField gradU(fvc::grad(God));
);
UEqn.solve();
}
I have compiled successfully, but I couldn't able to predict the velocity - shows constant magnitude during post-processing.


At the top, the similar matrix was created and compiled. In this (Below) vector matrix, after compilation - is there any change in vector variables (E and H) ? not sure. I feel that, its because the curl is defined explicitly.
Quote:

tmp<fvvectormatrix> EEqn
(
mu0*fvm::ddt(E)
==
- fvc::curl(H)
);
EEqn().relax();
EEqn().solve();
As Hrv stated, for implicit curl operators, block matrix implementation seems necessary. Its in Foam-Extend versions based on fully implicit method (FIM).
I haven't worked with it before. Looking ahead !!

If someone have exposed with block matrix method for simple linear equation, as like stated above., kindly share some thoughts and ideas.

Thank you !!


All times are GMT -4. The time now is 09:38.