timedomainresonace/src/solutioninstance.h

55 lines
1.2 KiB
C
Raw Normal View History

// solutioninstance.h
//
// Author: J.A. de Jong
//
// Description:
//
//////////////////////////////////////////////////////////////////////
2015-02-10 07:17:40 +00:00
#pragma once
#ifndef SOLUTIONINSTANCE_H
#define SOLUTIONINSTANCE_H 1
2015-02-10 07:17:40 +00:00
#include "vtypes.h"
#include "globalconf.h"
2015-02-20 09:34:05 +00:00
2015-02-10 07:17:40 +00:00
namespace td{
SPOILNAMESPACE
extern tasystem::Globalconf gc;
2015-02-10 07:17:40 +00:00
class SolutionInstance{
vd rho_,m_,rhoE_;
2015-02-10 07:17:40 +00:00
d time=0;
public:
2015-02-22 08:54:36 +00:00
SolutionInstance(int gp,d rho=0);
2015-02-10 07:17:40 +00:00
~SolutionInstance(){}
d getTime() const {return time;}
void setTime(d t) {time=t;}
vd& rho_ref(){ return rho_;}
vd& m_ref() {return m_;}
vd& rhoE_ref() {return rhoE_;}
2015-02-22 21:19:06 +00:00
const vd& rho() const {return rho_;}
const vd& m() const {return m_;}
const vd& rhoE() const {return rhoE_;}
2015-02-22 21:19:06 +00:00
vd p() const {return estat()*(gc.gas.gamma(gc.T0)-1);}
vd u() const {return m()/rho();}
vd ekin() const { return 0.5*rho()%pow(u(),2);}
vd estat() const {return rhoE()-ekin();}
vd Cflux() const {return m();}
vd Mflux() const {return pow(m(),2)/rho()+p();}
vd Eflux() const {return (rhoE()+gc.p0/(gc.gas.gamma(gc.T0)-1)+p()+gc.p0)%u();}
2015-02-10 07:17:40 +00:00
void setrho(d rho);
2015-02-10 07:17:40 +00:00
};
} // namespace td
#endif // SOLUTIONINSTANCE_H
//////////////////////////////////////////////////////////////////////