CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Modifying sonicFoam to add EM terms

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 11, 2015, 10:55
Default Modifying sonicFoam to add EM terms
  #1
New Member
 
Alexey Ryakhovskiy
Join Date: Sep 2014
Posts: 11
Rep Power: 11
Alexee is on a distinguished road
Hello, everyone!

I'm trying to include electromagnetic force UxB (where B is constant in time) and Joule heating into sonicFoam, but I'm having troubles modifying the equations.

I added B into createFields.H and terms into right hand sides of UEqn and EEqn, but it doesn't seem to work. (I have very little idea about programming with openFoam)

Here are the codes of equations I modified:

Code:
F = sigma*U^B^B;
fvVectorMatrix UEqn
(
    fvm::ddt(rho, U)
  + fvm::div(phi, U)
  + turbulence->divDevRhoReff(U)
  + F
);
solve(UEqn == -fvc::grad(p));
K = 0.5*magSqr(U);
EEqn
Code:
E = U^B;
J = sigma*E;
Q = J&E;

{
    solve
    (
        fvm::ddt(rho, e) + fvm::div(phi, e)
      + fvc::ddt(rho, K) + fvc::div(phi, K)
      + fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p, "div(phiv,p)")
      - fvm::laplacian(turbulence->alphaEff(), e)
      - Q
    );
  

    thermo.correct();
}
Can anyone please tell me, what is wrong with my code?

Last edited by Alexee; February 12, 2015 at 11:03.
Alexee is offline   Reply With Quote

Reply

Tags
mhd, openfoam, sonicfoam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
rotational and inviscid Mike Main CFD Forum 40 November 9, 2023 06:03
Adding source terms to rhoCentralFoam chriss85 OpenFOAM Programming & Development 1 July 1, 2023 13:08
How to add implicit terms to the momentum equation? MaryBau OpenFOAM Programming & Development 12 July 3, 2022 05:22
Source terms in sonicFoam / PIMPLE chriss85 OpenFOAM Programming & Development 12 July 6, 2015 04:59
K-Epsilon model? Brindaban Ghosh Main CFD Forum 2 June 24, 2000 04:22


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