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

alpha1<eps?0:u in compressibleTwoPhaseEulerFoam

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2014, 17:23
Default alpha1<eps?0:u in compressibleTwoPhaseEulerFoam
  #1
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 17
wouter is on a distinguished road
Hello All,

how can I do something like:
Code:
    volScalarField clipValue(1E-18);
    volVectorField U1_clip
    (
        IOobject
        (
            "U1_clip",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        alpha1 < clipValue?scalar(0):U1 // clip Ux if alphax <clipValue
    );
This does not work so do I need to loop through all cells?

Best regards
Wouter
wouter is offline   Reply With Quote

Old   January 29, 2014, 05:05
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
pos(alpha1-clipValue)*U1
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   January 29, 2014, 14:57
Default
  #3
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 17
wouter is on a distinguished road
hello All,
Thank you akidess for your answer. I tried various types (scalar, volScalarField(did not compile), label) for the clipvalue but I probable did not find the right one.
The result for U1_clip are (0 0 0) or (0 0.1 0) the first one is what I expected except that it is on unexpected places (alpha1 > 1E-18) and the other one is no good at all because the value of U at those places is (0.00970724 0.0137527 -0.0250987). Something goes wrong with the subtraction or with the multiplication. Could you please give me a direction where to look.

best regards
Wouter

Edit: it did work only I had to place the statements in write.H not in createFields.H. I used : const dimensionedScalar clipValue("clipValue",dimless,1.0e-8)

Last edited by wouter; January 29, 2014 at 17:53. Reason: found the solution
wouter is offline   Reply With Quote

Reply

Tags
clip u1 twophaseeuler

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



All times are GMT -4. The time now is 07:13.