Exemplo n.º 1
0
Foam::LESModels::PrandtlDelta::PrandtlDelta
(
    const word& name,
    const turbulenceModel& turbulence,
    const dictionary& dict
)
:
    LESdelta(name, turbulence),
    geometricDelta_
    (
        LESdelta::New
        (
            name,
            turbulence,
            dict.optionalSubDict(type() + "Coeffs")
        )
    ),
    kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
    Cdelta_
    (
        dict.optionalSubDict(type() + "Coeffs").lookupOrDefault<scalar>
        (
            "Cdelta",
            0.158
        )
    )
{
    calcDelta();
}
Exemplo n.º 2
0
void PrandtlDelta::correct()
{
    geometricDelta_().correct();

    if (mesh_.changing())
    {
        calcDelta();
    }
}
Exemplo n.º 3
0
void PrandtlDelta::read(const dictionary& d)
{
    const dictionary& dd(d.subDict(type() + "Coeffs"));

    geometricDelta_().read(dd);
    d.readIfPresent<scalar>("kappa", kappa_);
    dd.readIfPresent<scalar>("Cdelta", Cdelta_);
    calcDelta();
}
Exemplo n.º 4
0
void Foam::LESModels::PrandtlDelta::correct()
{
    geometricDelta_().correct();

    if (turbulenceModel_.mesh().changing())
    {
        calcDelta();
    }
}
Exemplo n.º 5
0
void Foam::LESModels::PrandtlDelta::read(const dictionary& dict)
{
    const dictionary& coeffDict(dict.optionalSubDict(type() + "Coeffs"));

    geometricDelta_().read(coeffDict);
    dict.readIfPresent<scalar>("kappa", kappa_);
    coeffDict.readIfPresent<scalar>("Cdelta", Cdelta_);
    calcDelta();
}
void PrandtlDelta::read(const dictionary& d)
{
    const dictionary& dd(d.subDict(type() + "Coeffs"));

    geometricDelta_().read(dd);
    kappa_ = dimensionedScalar(d.lookup("kappa")).value();
    Cdelta_ = dimensionedScalar(dd.lookup("Cdelta")).value();
    calcDelta();
}
Exemplo n.º 7
0
cubeRootVolDelta::cubeRootVolDelta
(
    const word& name,
    const fvMesh& mesh,
    const dictionary& dd
)
:
    LESdelta(name, mesh),
    deltaCoeff_(readScalar(dd.subDict(type() + "Coeffs").lookup("deltaCoeff")))
{
    calcDelta();
}
Exemplo n.º 8
0
int CSwriteIndex(CompressedStream *cs, ATerm term){
   long index;


   if(term==NULL){
      return HFencodeIndex(cs->bs, &cs->tree, NO_INT); 
   } else {
      if(!HTmember(cs->indices,term,&index)){
         index=HTinsert(cs->indices,term,NULL);
      }
      calcDelta(cs, &index);

      return HFencodeIndex(cs->bs, &cs->tree, index); 
   }
}
Exemplo n.º 9
0
void AppWindow::start(){
	setRunning(true);
	init();
	while(Running){
		if(!pause){
			calcDelta();
		}else{
			delta = 0;
		}
		while(SDL_PollEvent(&e)){
			updateInput(e);
		}
		updateAuto();
		render();
	}
}
Exemplo n.º 10
0
PrandtlDelta::PrandtlDelta
(
    const word& name,
    const fvMesh& mesh,
    const dictionary& dd
)
:
    LESdelta(name, mesh),
    geometricDelta_(LESdelta::New(name, mesh, dd.subDict(type() + "Coeffs"))),
    kappa_(dd.lookupOrDefault<scalar>("kappa", 0.41)),
    Cdelta_
    (
        dd.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Cdelta", 0.158)
    )
{
    calcDelta();
}
PrandtlDelta::PrandtlDelta
(
    const word& name,
    const fvMesh& mesh,
    const dictionary& dd
)
:
    LESdelta(name, mesh),
    geometricDelta_(LESdelta::New(name, mesh, dd.subDict(type() + "Coeffs"))),
    kappa_(dimensionedScalar(dd.lookup("kappa")).value()),
    Cdelta_
    (
        dimensionedScalar(dd.subDict(type() + "Coeffs").lookup("Cdelta"))
       .value()
    )
{
    calcDelta();
}
#include "owPhysicsFluidSimulator.h"
#include <stdexcept>
#include <iostream>
#include <fstream>

float calcDelta();
extern const float delta = calcDelta();
int iterationCount = 0;
extern int numOfElasticConnections = 0;
owPhysicsFluidSimulator::owPhysicsFluidSimulator(owHelper * helper)
{
	try{
		positionBuffer = new float[ 8 * PARTICLE_COUNT ];
		velocityBuffer = new float[ 4 * PARTICLE_COUNT ];
		//Helper Buffer this does not contain any sence. Only for usabiloty and debug
		densityBuffer = new float[ 1 * PARTICLE_COUNT ];
		particleIndexBuffer = new unsigned int[PARTICLE_COUNT * 2];
		//
		numOfLiquidP = 0;
		numOfElasticP = 0;
		numOfBoundaryP = 0;
		owHelper::loadConfiguration( positionBuffer, velocityBuffer, elasticConnections, numOfLiquidP, numOfElasticP, numOfBoundaryP, numOfElasticConnections );		//Load configuration from file to buffer
		if(numOfElasticConnections != 0){
			ocl_solver = new owOpenCLSolver(positionBuffer,velocityBuffer,elasticConnections);	//Create new openCLsolver instance
		}else
			ocl_solver = new owOpenCLSolver(positionBuffer,velocityBuffer);	//Create new openCLsolver instance
		this->helper = helper;
	}catch( std::exception &e ){
		std::cout << "ERROR: " << e.what() << std::endl;
		exit( -1 );
	}