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

Passing functions to solver

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 12, 2017, 21:17
Default Passing functions to solver
  #1
New Member
 
Join Date: Aug 2017
Posts: 2
Rep Power: 0
gezibash is on a distinguished road
Hi,

I am writing my own solver for a problem and I've been able to implement most features I need, however one is proving to be a bit difficult.

The idea is that I have an h field which I can most easily describe as a function

h = f(x,y)

This field is then used in the solver to generate a pressure distribution. Here is the solve block as is atm

Code:
        while (simple.correctNonOrthogonal())
        {

          if(runTime.value() < 3e-5){
            h = planarOffset;
          }
          else {
            h = 6.667e-3 * mesh.C().component(vector::Y);
          } 

          solve
          (
            (1/(12*Mu))*(fvm::laplacian(pow(h,3)*p,p)) == fvm::ddt(h,p)
          );
        }
This will compile and it works. My issue is can I somehow pass this portion

Code:
          if(runTime.value() < 3e-5){
            h = planarOffset;
          }
          else {
            h = 6.667e-3 * mesh.C().component(vector::Y);
          }
from the problem statement through some sort of boundary condition or something. I can do it like this, but I would like to test out a few different h fields, and I have to wmake all the time. I would prefer if the solver was a bit more general.
gezibash is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Population Balance Modeling (PBM) - Ansys Fluent chittipo FLUENT 164 November 18, 2023 12:54
fluent divergence for no reason sufjanst FLUENT 2 March 23, 2016 17:08
Quarter Burner mesh with periosic condition SamCanuck FLUENT 2 August 31, 2011 12:34
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
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 22:50.