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

Modify Existing Solver

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By RobertHB
  • 1 Post By Luis F

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 16, 2018, 10:14
Default Modify Existing Solver
  #1
New Member
 
Join Date: Mar 2018
Posts: 7
Rep Power: 8
Luis F is on a distinguished road
Dear all,

I am trying to modify my own solver based in simpleFoam. I managed to make a copy and paste it in my own folder, but that's it.

I am working in the pitzDaily tutorial and my intention is to introduce Reynolds stresses calculated by me and simulate it. Basically I don't need to solve the transport equations for k and epsilon (Im using the k-psilon model), because I already have the Reynolds stresses.

I assume I have to modify the dicrectory createFields.H, but my knowledge in C++ is 0.

I appreciate any hint in that regard.

Last edited by Luis F; March 19, 2018 at 03:11.
Luis F is offline   Reply With Quote

Old   March 19, 2018, 04:37
Default
  #2
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12
RobertHB is on a distinguished road
There is a bunch of tutorials on how to modify/create your own solver. For example on youtube [1] [2], the OpenFoam wiki [3], sourceflux [4] and available from Chalmers courses [5]. All of those are a good place to start.
BenGher and mcfdma like this.
RobertHB is offline   Reply With Quote

Old   March 19, 2018, 04:42
Default
  #3
New Member
 
Join Date: Mar 2018
Posts: 7
Rep Power: 8
Luis F is on a distinguished road
Dear Robert,

Thank you very much for your answer, I will take a look
Luis F is offline   Reply With Quote

Old   March 19, 2018, 04:47
Default
  #4
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12
RobertHB is on a distinguished road
Not to forget this great collection of slides from C. Soulaine on researchgate.
RobertHB is offline   Reply With Quote

Old   March 20, 2018, 09:38
Default Momentum predictor
  #5
New Member
 
Join Date: Mar 2018
Posts: 7
Rep Power: 8
Luis F is on a distinguished road
Dear all,

I have checked all the links mentioned in this post and I reached the conclusion that the best way to handle it, is to add a new term in the momentum equation:

// Momentum predictor

tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
+ turbulence->divDevReff(U)
+ fvc::div(RN) // Added by me: influence of Rij
==
fvOptions(U)
);

UEqn().relax();

fvOptions.constrain(UEqn());

solve(UEqn() == -fvc::grad(p));

fvOptions.correct(U);

Being RN an increment of the reynolds stresses calculated by me.

Nevertheless I get an error when I try to build the solver (.dep file).

I created the RN in the createFields.H like this:

Info<< "Reading field RN\n" << endl;
volSymmTensorField RN
(
IOobject
(
"RN",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

Best regards
HHK_1702 likes this.
Luis F is offline   Reply With Quote

Reply

Tags
simplefoam, solver modification


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 set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
PEMFC model with FLUENT brahimchoice FLUENT 22 April 19, 2020 16:44
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
How to start CFX Solver with an existing parfile lentschi CFX 3 February 20, 2011 14:31
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 15:08


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