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

[OpenFOAM 11] Adding new equations in modular solvers

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2024, 19:09
Question [OpenFOAM 11] Adding new equations in modular solvers
  #1
New Member
 
Aryaman
Join Date: Apr 2024
Posts: 1
Rep Power: 0
blackk100 is on a distinguished road
I'm setting up a custom modular solver to simulate electrochemical cells in OpenFOAM 11. I've created a derived class from multicomponentFluid that compiles and runs.

I'm currently attempting to add in another scalar field variable for the electric potential, but I cannot figure out how to do that exactly (OF10 & OF2312 are straightforward with this).

This is what I attempted (does not compile):
customFluid.C:
Code:
Foam::solvers::customFluid::customFluid(fvMesh& mesh)
:
multicomponentFluid(mesh),
E_(
    IOobject("E", runTime.name(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE),
    mesh
),
E(E_)
{}
customFluid.H:
Code:
...
class customFluid: public multicomponentFluid
{
protected:
    volScalarField &E_;
private:
public:
    const volScalarField &E;

   TypeName("customFluid");
...
}
I did notice the scalarTransport function, but it does not cover all of my needs (I need to add terms dependent on E to the U and Y equations).

Would appreciate any help on this!

Last edited by blackk100; April 4, 2024 at 19:10. Reason: Formatting
blackk100 is offline   Reply With Quote

Reply

Tags
openfoam 11


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
Guide: Writing Equations in LaTeX on the CFD Online Forums pete Site Help, Feedback & Discussions 27 May 19, 2022 03:19
Adding extra terms in governing equations Alek FLUENT 0 January 30, 2014 10:20
Adding two Energy Equations to Porous Solver Filankes OpenFOAM Programming & Development 2 December 3, 2013 05:20
modelling Differential equations in a udf RikardMNorén Fluent UDF and Scheme Programming 2 October 1, 2013 03:36
Adding equations to existing solvers treima OpenFOAM Programming & Development 0 July 9, 2012 09:46


All times are GMT -4. The time now is 07:22.