|
[Sponsors] |
December 7, 2023, 07:59 |
Creating a new unary_function
|
#1 |
New Member
Join Date: Nov 2023
Posts: 2
Rep Power: 0 |
I would like to create a new unary_function in OpenFOAM
Code:
inline scalar newSign(const scalar s) { return (s > 0)? 1: -1; } |
|
December 7, 2023, 12:42 |
|
#2 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40 |
Quote:
You may want something something similar for vectors ? I don't know. To add in everywhere you will need to touch the following files (header + source):
In addition, you will also need to define how the dimensions change (or don't) - some code in dimensionSet.{C,H} However, how useful is it to have -1 as the sign for a zero value? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[SOWFA] NREL SOWFA ABLTerrainSolver tutorial problem | cico0815 | OpenFOAM Community Contributions | 36 | February 3, 2022 11:54 |
OpenFoam restarting simulation, stops at first Time loop | syntex | OpenFOAM Running, Solving & CFD | 4 | April 5, 2019 11:20 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 18:57 |
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) | cfdonline2mohsen | OpenFOAM | 3 | October 21, 2013 09:28 |
Problem in running ICEM grid in Openfoam | Tarak | OpenFOAM | 6 | September 9, 2011 17:51 |