|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Joanne
Join Date: Aug 2017
Location: Ireland
Posts: 6
Rep Power: 10 ![]() |
Hi all, I was hoping someone could shed some light.
I am looking to create a scalar field that varies linearly as a function of space and would like to know if there's a way to do it through setFieldsDict. I am using OF v4.1 on ubuntu 16.06 so unfortunately swak4foam isn't available for me without a complete overhaul. Any help would be deeply appreciated. |
|
|
|
|
|
|
|
|
#2 |
|
Member
|
Hi Joanne
Not sure if this is what you are looking for but this post may assist: VOF initialization with a STL file (closed volume) Regards JFM |
|
|
|
|
|
|
|
|
#3 |
|
Senior Member
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 13 ![]() |
A while ago I used this snippet for setting a parabolic boundary condition for U at the inlet:
Code:
inlet
{
type codedFixedValue;
value uniform (0 0 0);
redirectType parabolaProfile;
code
#{
const fvPatch& boundaryPatch = patch();
const vectorField& Cf = boundaryPatch.Cf();
vectorField& field = *this;
scalar uave = 10;
scalar h = 5e-3;
scalar vel;
forAll(Cf, faceI)
{
vel = 6 * uave / (h*h) * (h * Cf[faceI].y() - Cf[faceI].y() * Cf[faceI].y());
field[faceI] = vector(vel, 0, 0);
}
#};
}
|
|
|
|
|
|
![]() |
| Tags |
| setfields, setfieldsdict, spatial variation |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| rho Constructor interFoam for creating a varying rho field | kebsiali | OpenFOAM Programming & Development | 4 | April 16, 2016 21:28 |
| [General] How to create an additional vector with {Field 4, Field 5, Field 6} | Bombacar | ParaView | 1 | August 15, 2015 19:05 |
| ''unknown radialModelType type Gidaspow'' PROBLEM WITH THE BED TUTORIAL | AndoniBM | OpenFOAM Running, Solving & CFD | 2 | March 25, 2015 19:44 |
| New BoundaryCondition: how to modify a single component of a field? | look86 | OpenFOAM Programming & Development | 4 | August 28, 2012 17:48 |
| Demagnetization field | jan0385 | ANSYS | 0 | April 12, 2012 10:09 |