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

How to implement equation while making a new solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 7, 2021, 11:42
Default How to implement equation while making a new solver
  #1
New Member
 
yasmin
Join Date: Mar 2021
Posts: 2
Rep Power: 0
yasmin is on a distinguished road
Hiya
I am trying to create a new solver which is supposed to calculate the flux equation, j=B/vlm[ln(γ_2 c_2 )-ln(γ_1 c_1 )] I implemented the equation in the way of C++ .
C2 was defined as a volScalarField and the other variables were defined as dimensionScalar in the createfieldS file
while (simple.correctNonOrthogonal())
As implemented in the description below
{
fvVectorMatrix memfluxEqn
int main()
(
float B,vlm,C1,C2,gmm2,gmm1;
cin >>B;
cin >>vlm;
cin >>C1;
cin >>gmm2;
cin >>gmm1;
cin >>C2;
);
std::cout << B/vlm*(log(C2*gmm2)-log(C1*gmm1)) <<endl;
// memfluxEqn.relax();
// memfluxEqn.solve();
}
// Passive scalar transport equation
while (simple.correctNonOrthogonal())
{
fvScalarMatrix psiEqn
(
fvm::ddt(C2)
+fvm::div(phi, C2)
-fvm::laplacian(gammaC2, C2)
);
psiEqn.relax();
psiEqn.solve();
}
runTime.write();
However, when I run the whole files in Ubuntu terminal I’m constantly receiving this error messages
Please can someone help me to solve this error? I would really really appreciate some help.

I have attached a photo of the error
Attached Images
File Type: jpg Slide1.jpg (143.0 KB, 6 views)
yasmin 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
Setting the height of the stream in the free channel kevinmccartin CFX 12 October 13, 2022 21:43
Domain Reference Pressure and mass flow inlet boundary AdidaKK CFX 75 August 20, 2018 05:37
Problem with Velocity Poisson Equation and Vector Potential Poisson Equation mykkujinu2201 Main CFD Forum 1 August 12, 2017 13:15
Poisson equation in custom solver diverges for large boundary values babakflame OpenFOAM Running, Solving & CFD 2 May 23, 2017 20:11
Help for the small implementation in turbulence model shipman OpenFOAM Programming & Development 25 March 19, 2014 10:08


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