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

Adding a cross product source term

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By lazersos

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2011, 15:18
Question Adding a cross product source term
  #1
New Member
 
lazersos@gmail.com
Join Date: Apr 2011
Posts: 11
Rep Power: 15
lazersos is on a distinguished road
I want to solve for 2-Fluid (ion-electron) steady state flow. Now it seems that between mhdFoam and simpleFoam this should be possible. In essence I need to add a v x B term to the simpleFoam velocity solver. My guess is this should look something like:

Code:
{
   fvVectorMatrix UEqn
   (
          fvm::div(phi,U)
   );
   eqnResidual = solve(UEqn == -fvc::grad(p)+  fvm::Sp(qi,crossProduct(Ui,B))).initialResidual();
}
In essence I'll want to solve this once for the ion fluid then once for the electron fluid. Then I'll calculate the current from the velocities and the modification of the field by the current. I'm also going to assume a fixed pressure profile. Any thoughts on adding a source term or experience with the forms of Sp?
lazersos is offline   Reply With Quote

Old   June 6, 2011, 12:14
Default Followup
  #2
New Member
 
lazersos@gmail.com
Join Date: Apr 2011
Posts: 11
Rep Power: 15
lazersos is on a distinguished road
Well I got a version to compile anyway, now I just have to figure out how to set my initial condition for my solver (gradient fields, etc). Here's the code:

Code:
       volVectorField UxF;
       {
            UxF = U ^ F;  // U x F Term
            // --- Solve for Ion Velocity
            fvVectorMatrix UiEqn
            (
                  fvm::div(phii, U)
                + fvm::Sp(q, UxF)
              
            );
            eqnResidual = solve(UiEqn == -fvc::grad(p)).initialResidual();
            maxResidual = max(eqnResidual, maxResidual);

        }
lazersos is offline   Reply With Quote

Old   June 9, 2011, 10:44
Default
  #3
Member
 
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 16
fisch is on a distinguished road
Hello lazersos,

as far as i get it you add a source term called UxF and then you have to integrate it over the control volume.

For that you call "+fvm::Sp(q,UxF)" to integrate UxF over each cell volume, right? But what is q here?

thanks for a reply,
rupert
fisch is offline   Reply With Quote

Old   June 9, 2011, 11:24
Default
  #4
New Member
 
lazersos@gmail.com
Join Date: Apr 2011
Posts: 11
Rep Power: 15
lazersos is on a distinguished road
This is what I got to compile:

Code:
            UxF = U ^ F;
            // --- Solve for Ion Velocity
            fvVectorMatrix UEqn
            (
                  fvm::div(phi, U)
                + fvm::Sp(q, UxF)
              
            );
            eqnResidual = solve(UEqn == -fvc::grad(p)).initialResidual();
            maxResidual = max(eqnResidual, maxResidual);
I believe this is the correct way to proceed as U is the quantity being varied so the implicit source term should reside in the fvVectorMatrix. The q term is just some scalar multiple in front of the source term as far as I can tell.
Kummi likes this.
lazersos is offline   Reply With Quote

Reply


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
How to define a transient species source term? aleisia FLUENT 3 March 7, 2011 23:58
Adding a source term to concervation of species equation bernarde STAR-CCM+ 0 June 4, 2009 04:17
Adding volumetric Source Term mohanamuraly OpenFOAM 0 May 17, 2009 23:00
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51
UDF Source Term Units? Brian FLUENT 1 October 24, 2005 10:15


All times are GMT -4. The time now is 13:33.